HttpUtility.UrlKeyValueEncode 方法 (String, String)
將編碼的字串索引鍵和用於 URL 查詢字串中的值。
命名空間: Microsoft.SharePoint.Client.Utilities
組件: Microsoft.SharePoint.Client (在 Microsoft.SharePoint.Client.dll 中)
語法
'宣告
Public Shared Function UrlKeyValueEncode ( _
keyToEncode As String, _
valueToEncode As String _
) As String
'用途
Dim keyToEncode As String
Dim valueToEncode As String
Dim returnValue As String
returnValue = HttpUtility.UrlKeyValueEncode(keyToEncode, _
valueToEncode)
public static string UrlKeyValueEncode(
string keyToEncode,
string valueToEncode
)
參數
keyToEncode
類型:System.String要編碼索引鍵的字串。
valueToEncode
類型:System.String要編碼的值字串。
傳回值
類型:System.String
編碼的字串。
備註
使用UrlKeyValueEncode(Guid)方法編碼來建構,而不傳遞現有的 URL,例如的 URL、 使用者輸入的 URL。
若要編碼,作為屬性值 URL 類型屬性指定的字串,使用HtmlUrlAttributeEncode()方法。
若要編碼 HTML 字串,使用HtmlEncode(String)方法。