共用方式為


SPHttpUtility.UrlPathEncode method (String, Boolean, Boolean, Boolean)

將編碼 Web 伺服器來自可靠的 HTTP 傳輸,用戶端的 URL 的路徑的部分。

Namespace:  Microsoft.SharePoint.Utilities
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'宣告
Public Shared Function UrlPathEncode ( _
    urlToEncode As String, _
    allowHashParameter As Boolean, _
    encodeUnicodeCharacters As Boolean, _
    rfcCompliant As Boolean _
) As String
'用途
Dim urlToEncode As String
Dim allowHashParameter As Boolean
Dim encodeUnicodeCharacters As Boolean
Dim rfcCompliant As Boolean
Dim returnValue As String

returnValue = SPHttpUtility.UrlPathEncode(urlToEncode, _
    allowHashParameter, encodeUnicodeCharacters, _
    rfcCompliant)
public static string UrlPathEncode(
    string urlToEncode,
    bool allowHashParameter,
    bool encodeUnicodeCharacters,
    bool rfcCompliant
)

參數

  • allowHashParameter
    Type: System.Boolean

    true 以容許雜湊參數 ;否則,false。

  • rfcCompliant
    Type: System.Boolean

    進行 URL 編碼與 RFC 3986 相容吗?請將它設定為除了傳統的程式碼相容性,則為 True。

傳回值

Type: System.String
編碼的 URL。如果 urlToEncode 參數是空的和空值如果 urlToEncode 參數為 null,空白。

請參閱

參照

SPHttpUtility class

SPHttpUtility members

UrlPathEncode overload

Microsoft.SharePoint.Utilities namespace