FileSystemInfo.FullName Propriété

Définition

Obtient le chemin d'accès complet du répertoire ou fichier.

public:
 virtual property System::String ^ FullName { System::String ^ get(); };
public virtual string FullName { get; }
member this.FullName : string
Public Overridable ReadOnly Property FullName As String

Valeur de propriété

String

Chaîne contenant le chemin d’accès complet.

Exceptions

Le chemin complet et le nom de fichier dépassent la longueur maximale définie par le système.

L'appelant n'a pas l'autorisation requise.

Exemples

L’exemple suivant illustre la FullName propriété. Cet exemple de code fait partie d’un exemple plus grand fourni pour la FileSystemInfo classe.

static void DisplayFileSystemInfoAttributes(FileSystemInfo^ fsi)
{
    //  Assume that this entry is a file.
    String^ entryType = "File";

    // Determine if entry is really a directory
    if ((fsi->Attributes & FileAttributes::Directory) == FileAttributes::Directory)
    {
        entryType = "Directory";
    }
    //  Show this entry's type, name, and creation date.
    Console::WriteLine("{0} entry {1} was created on {2:D}", entryType, fsi->FullName, fsi->CreationTime);
}
static void DisplayFileSystemInfoAttributes(FileSystemInfo fsi)
{
    //  Assume that this entry is a file.
    string entryType = "File";

    // Determine if entry is really a directory
    if ((fsi.Attributes & FileAttributes.Directory) == FileAttributes.Directory )
    {
        entryType = "Directory";
    }
    //  Show this entry's type, name, and creation date.
    Console.WriteLine("{0} entry {1} was created on {2:D}", entryType, fsi.FullName, fsi.CreationTime);
}
Sub DisplayFileSystemInfoAttributes(ByVal fsi As IO.FileSystemInfo)
    ' Assume that this entry is a file.
    Dim entryType As String = "File"

    ' Determine if this entry is really a directory.
    If (fsi.Attributes And FileAttributes.Directory) = FileAttributes.Directory Then
        entryType = "Directory"
    End If

    ' Show this entry's type, name, and creation date.
    Console.WriteLine("{0} entry {1} was created on {2:D}", _
        entryType, fsi.FullName, fsi.CreationTime)
End Sub

Remarques

Par exemple, pour un fichier c:\NewFile.txt, cette propriété retourne « c:\NewFile.txt ».

Pour obtenir la liste des tâches courantes d’E/S, consultez Tâches d’E/S courantes.

S’applique à

Voir aussi