本文整理汇总了VB.NET中System.Web.HttpServerUtility.HtmlEncode方法的典型用法代码示例。如果您正苦于以下问题:VB.NET HttpServerUtility.HtmlEncode方法的具体用法?VB.NET HttpServerUtility.HtmlEncode怎么用?VB.NET HttpServerUtility.HtmlEncode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。
在下文中一共展示了HttpServerUtility.HtmlEncode方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1:
Public Class _Default
Inherits Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
Result.Text = Server.HtmlEncode("<script>unsafe</script>")
End Sub
End Class
示例2: SampleClass
Public Class SampleClass
Public Function GetEncodedText() As String
Return HttpContext.Current.Server.HtmlEncode("<script>unsafe</script>")
End Function
End Class
示例3:
Dim TestString As String = "This is a <Test String>."
Dim writer As New StringWriter
Server.HtmlEncode(TestString, writer)
Dim EncodedString As String = writer.ToString()