Freigeben über


Web.GetFileByServerRelativeUrl-Methode

Returns the file object located at the specified server-relative URL.

Namespace:  Microsoft.SharePoint.Client
Assemblys:   Microsoft.SharePoint.Client.Silverlight (in Microsoft.SharePoint.Client.Silverlight.dll);  Microsoft.SharePoint.Client.Phone (in Microsoft.SharePoint.Client.Phone.dll)  Microsoft.SharePoint.Client (in Microsoft.SharePoint.Client.dll)

Syntax

'Declaration
Public Function GetFileByServerRelativeUrl ( _
    serverRelativeUrl As String _
) As File
'Usage
Dim instance As Web
Dim serverRelativeUrl As String
Dim returnValue As File

returnValue = instance.GetFileByServerRelativeUrl(serverRelativeUrl)
public File GetFileByServerRelativeUrl(
    string serverRelativeUrl
)

Parameter

  • serverRelativeUrl
    Typ: System.String

    A string that specifies the server-relative URL for the file.

Rückgabewert

Typ: Microsoft.SharePoint.Client.File
A File object that represents the file.

Ausnahmen

Ausnahme Bedingung
ArgumentException

The serverRelativeUrl does not start with a '/' or serverRelativeUrl does not correspond to a file.

Hinweise

It must not be ein Nullverweis (Nothing in Visual Basic). It must not be empty.

Siehe auch

Referenz

Web Klasse

Web-Member

Microsoft.SharePoint.Client-Namespace