共用方式為


SPUtility.GetServerRelativeUrlFromPrefixedUrl method

將轉換成以 URL"~ 網站 /"或"~sitecollection/"到伺服器相對 URL。

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

Syntax

'宣告
Public Shared Function GetServerRelativeUrlFromPrefixedUrl ( _
    prefixedUrl As String _
) As String
'用途
Dim prefixedUrl As String
Dim returnValue As String

returnValue = SPUtility.GetServerRelativeUrlFromPrefixedUrl(prefixedUrl)
public static string GetServerRelativeUrlFromPrefixedUrl(
    string prefixedUrl
)

參數

傳回值

Type: System.String
包含伺服器相對 URL 的字串

備註

如果prefixedUrl參數無法啟動具有"~ 網站 /"或"~sitecollection/",則它將傳回而修改。

請參閱

參照

SPUtility class

SPUtility members

Microsoft.SharePoint.Utilities namespace