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
)
參數
urlAttributeToEncode
類型:System.StringString方式呈現資料編碼。
傳回值
類型:System.String
編碼值的String表示。
備註
HtmlUrlAttributeEncode(String)方法檢查 URL 通訊協定,如果 URL 是相對或允許的通訊協定,編碼的字串,用於做為屬性值。它不會編碼路徑或 URL 查詢字串。如果您要建立的 URL,來電UrlPathEncode() 和UrlKeyValueEncode分別前釐這個方法。