共用方式為


HttpUtility.HtmlUrlAttributeEncode 方法 (String)

將指定的字串,作為屬性值 URL 類型的屬性,例如錨點標記href屬性或影像標籤src屬性編碼。

命名空間:  Microsoft.SharePoint.Client.Utilities
組件:  Microsoft.SharePoint.Client (在 Microsoft.SharePoint.Client.dll 中)

語法

'宣告
Public Shared Function HtmlUrlAttributeEncode ( _
    urlAttributeToEncode As String _
) As String
'用途
Dim urlAttributeToEncode As String
Dim returnValue As String

returnValue = HttpUtility.HtmlUrlAttributeEncode(urlAttributeToEncode)
public static string HtmlUrlAttributeEncode(
    string urlAttributeToEncode
)

參數

傳回值

類型:System.String
編碼值的String表示。

備註

HtmlUrlAttributeEncode(String)方法檢查 URL 通訊協定,如果 URL 是相對或允許的通訊協定,編碼的字串,用於做為屬性值。它不會編碼路徑或 URL 查詢字串。如果您要建立的 URL,來電UrlPathEncode()UrlKeyValueEncode分別前釐這個方法。

請參閱

參照

HttpUtility 類別

HttpUtility 成員

HtmlUrlAttributeEncode 多載

Microsoft.SharePoint.Client.Utilities 命名空間