Web.GetFolderByServerRelativeUrl 方法
傳回位於指定伺服器相對 URL 的資料夾物件。
命名空間: Microsoft.SharePoint.Client
組件: Microsoft.SharePoint.Client.Silverlight (在 Microsoft.SharePoint.Client.Silverlight.dll 中); Microsoft.SharePoint.Client.Phone (在 Microsoft.SharePoint.Client.Phone.dll 中) Microsoft.SharePoint.Client (在 Microsoft.SharePoint.Client.dll 中)
語法
'宣告
Public Function GetFolderByServerRelativeUrl ( _
serverRelativeUrl As String _
) As Folder
'用途
Dim instance As Web
Dim serverRelativeUrl As String
Dim returnValue As Folder
returnValue = instance.GetFolderByServerRelativeUrl(serverRelativeUrl)
public Folder GetFolderByServerRelativeUrl(
string serverRelativeUrl
)
參數
serverRelativeUrl
類型:System.String指定資料夾的伺服器相對 URL 的字串。
傳回值
類型:Microsoft.SharePoint.Client.Folder
Folder 物件的資料夾。
例外狀況
例外狀況 | 條件 |
---|---|
FileNotFoundException | serverRelativeUrl未對應至資料夾或檔案,或不起始 '/'。錯誤碼 ︰-2147024809。 |
備註
您必須執行的程式碼,使用GetFolderByServerRelativeUrl方法瀏覽目錄權限。
它不能null 參考 (未執行任何動作 於 Visual Basic 中)。