次の方法で共有


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

Encodes path portion of an URL for reliable HTTP transmission from the Web server to a client.

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

Syntax

'Declaration
Public Shared Function UrlPathEncode ( _
    urlToEncode As String, _
    allowHashParameter As Boolean, _
    encodeUnicodeCharacters As Boolean, _
    rfcCompliant As Boolean _
) As String
'Usage
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
)

Parameters

  • allowHashParameter
    Type: System.Boolean

    true to allow hash paramter; otherwise, false.

  • rfcCompliant
    Type: System.Boolean

    Make the URL encoding compliant with RFC 3986? Set it to True except for legacy code compatibility.

Return value

Type: System.String
The encoded URL. Empty if the urlToEncode parameter is empty and null if the urlToEncode parameter is null.

See also

Reference

SPHttpUtility class

SPHttpUtility members

UrlPathEncode overload

Microsoft.SharePoint.Utilities namespace