共用方式為


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
)

參數

  • quoteChar
    Type: System.Char

    System.Char ,指定要用於引號字元。

備註

WriteHtmlEncodeWithQuote方法會將轉換無法與實體的 HTML 標籤混淆的字元。例如,"<"轉換成"& lt;"。

此方法會將字串中的多個空格取代為單一空格。

請參閱

參照

SPEncode class

SPEncode members

Microsoft.SharePoint.Utilities namespace