Partager via


Web.GetFileByServerRelativeUrl - Méthode

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

Espace de noms :  Microsoft.SharePoint.Client
Assemblys :   Microsoft.SharePoint.Client.Silverlight (dans Microsoft.SharePoint.Client.Silverlight.dll);  Microsoft.SharePoint.Client.Phone (dans Microsoft.SharePoint.Client.Phone.dll)  Microsoft.SharePoint.Client (dans Microsoft.SharePoint.Client.dll)

Syntaxe

'Déclaration
Public Function GetFileByServerRelativeUrl ( _
    serverRelativeUrl As String _
) As File
'Utilisation
Dim instance As Web
Dim serverRelativeUrl As String
Dim returnValue As File

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

Paramètres

  • serverRelativeUrl
    Type : System.String

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

Valeur renvoyée

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

Exceptions

Exception Condition
ArgumentException

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

Remarques

It must not be une référence Null (Rien dans Visual Basic). It must not be empty.

Voir aussi

Référence

Web classe

Web - Membres

Microsoft.SharePoint.Client - Espace de noms