共用方式為


SPUtility.ReplaceEmbeddedPrefixedUrlsWithServerRelativeUrls method (String, Boolean)

將指定的相對 URL 與內嵌的前置字元轉換成伺服器相對 URL,並選擇性地將編碼站台首碼。

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

Syntax

'宣告
Public Shared Function ReplaceEmbeddedPrefixedUrlsWithServerRelativeUrls ( _
    value As String, _
    ecmaScriptStringLiteralEncode As Boolean _
) As String
'用途
Dim value As String
Dim ecmaScriptStringLiteralEncode As Boolean
Dim returnValue As String

returnValue = SPUtility.ReplaceEmbeddedPrefixedUrlsWithServerRelativeUrls(value, _
    ecmaScriptStringLiteralEncode)
public static string ReplaceEmbeddedPrefixedUrlsWithServerRelativeUrls(
    string value,
    bool ecmaScriptStringLiteralEncode
)

參數

  • ecmaScriptStringLiteralEncode
    Type: System.Boolean

    要編碼的站台首碼 ; true否則,請false。

傳回值

Type: System.String
會傳回伺服器相對 URL String表示。

備註

此方法將轉換成具有前置詞的 URL"~ 網站 /"或"~sitecollection/"伺服器相對 url。

請參閱

參照

SPUtility class

SPUtility members

ReplaceEmbeddedPrefixedUrlsWithServerRelativeUrls overload

Microsoft.SharePoint.Utilities namespace