English 中文(简体)
将文号特征改为“VB”。 NET
原标题:Converting Symbol Characters to HTML with VB.NET

我试图确保不计数或字母的所有特性在提交我的数据库时都转换成超文本。

在戈格宁角,我来这里是为了:

Public Shared Function HTMLEncodeSpecialChars(text As String) As String
    Dim sb As New System.Text.StringBuilder()

    Dim i As Integer
    Dim charArray() As Char = text.ToCharArray()
      display contents of charArray
    For i = 0 To charArray.Length - 1
        sb.Append((String.Format("&#{0};", Asc(charArray(i)))) & ",")
    Next
    Return sb.ToString()
End Function

这成功地将任何东西转换为超文本,但现在我需要在那里设置某种条件,以便我只需要这样做。 例如,无论哪种性质,如果将重新输入我的数据库,或重新编排格式,然后作为超文本重新回到屏幕上(数据库内容是用于网站的产品数据)。

因此,为了简单起见,我猜想我只想改变不是A-Z字母缩略语或1-0数字的果园。

我可以使用Numeric,但不能确定如何发现甲型六氯环己烷。

我先是 Go笑,发现一些像它那样做的事情,但逻辑/渗透是错误的。

因此,我在此问:D

最佳回答

你们说,现有工具为什么不给你工作,因此你可能不知道:

HtmlEncode。 网页:

HTML encoding makes sure that text is displayed correctly in the browser and not interpreted by the browser as HTML.

问题回答

暂无回答




相关问题
Is Shared ReadOnly lazyloaded?

I was wondering when I write Shared ReadOnly Variable As DataType = New DataType() Or alternatively Shared ReadOnly Variable As New DataType() Is it lazy loaded or as the instance initializes? ...

Entertaining a baby with VB.NET

I would like to write a little application in VB.NET that will detect a baby s cry. How would I get started with such an application?

Choose Enter Rather than Pressing Ok button

I have many fields in the page and the last field is a dropdown with list of values. When I select an item in a dropdown and press Enter, it doesn t do the "Ok". Instead I have to manually click on Ok ...

ALT Key Shortcuts Hidden

I am using VS2008 and creating forms. By default, the underscore of the character in a textbox when using an ampersand is not shown when I run the application. ex. "&Goto Here" is not ...

Set Select command in code

On button Click I want to Set the Select command of a Gridview. I do this and then databind the grid but it doesn t work. What am i doing wrong? protected void bttnView_Click(object sender, ...

Hover tooltip on specific words in rich text box?

I m trying to create something like a tooltip suddenly hoovering over the mouse pointer when specific words in the richt text box is hovered over. How can this be done?

热门标签