Web.GetFileByServerRelativeUrl 方法
Returns the file object located at the specified server-relative 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.StringA string that specifies the server-relative URL for the file.
返回值
类型:Microsoft.SharePoint.Client.File
A File object that represents the file.
异常
异常 | 条件 |
---|---|
ArgumentException | The serverRelativeUrl does not start with a '/' or serverRelativeUrl does not correspond to a file. |
备注
It must not be 空引用(无 在 Visual Basic 中). It must not be empty.