Web.GetFileByServerRelativeUrl 方法
傳回位於指定伺服器相對 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 GetFileByServerRelativeUrl ( _
serverRelativeUrl As String _
) As File
'用途
Dim instance As Web
Dim serverRelativeUrl As String
Dim returnValue As File
returnValue = instance.GetFileByServerRelativeUrl(serverRelativeUrl)
public File GetFileByServerRelativeUrl(
string serverRelativeUrl
)
參數
serverRelativeUrl
類型:System.String指定檔案的伺服器相對 URL 的字串。
傳回值
類型:Microsoft.SharePoint.Client.File
表示檔案File物件。
例外狀況
例外狀況 | 條件 |
---|---|
ArgumentException | serverRelativeUrl開頭不 '/' 或serverRelativeUrl未對應至檔案]。 |
備註
它不能null 參考 (未執行任何動作 於 Visual Basic 中)。它必須不是空的。