SPEncode.WriteHtmlEncodeWithQuote method
會指定的字串的編碼,使內嵌的 HTML 標籤中的字元會顯示在瀏覽器] 的文字,並將字串引號括住寫入至 HTTP 輸出內容資料流。
Namespace: Microsoft.SharePoint.Utilities
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'宣告
Public Shared Sub WriteHtmlEncodeWithQuote ( _
response As HttpResponse, _
str As String, _
quoteChar As Char _
)
'用途
Dim response As HttpResponse
Dim str As String
Dim quoteChar As CharSPEncode.WriteHtmlEncodeWithQuote(response, _
str, quoteChar)
public static void WriteHtmlEncodeWithQuote(
HttpResponse response,
string str,
char quoteChar
)
參數
response
Type: System.Web.HttpResponse目前 HTTP 要求 System.HttpResponse 物件。
str
Type: System.String要編碼的字串。
quoteChar
Type: System.CharSystem.Char ,指定要用於引號字元。
備註
WriteHtmlEncodeWithQuote方法會將轉換無法與實體的 HTML 標籤混淆的字元。例如,"<"轉換成"& lt;"。
此方法會將字串中的多個空格取代為單一空格。