Sdílet prostřednictvím


FileSystemInfo.FullName Vlastnost

Definice

Získá úplnou cestu k adresáři nebo souboru.

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

Hodnota vlastnosti

Řetězec obsahující úplnou cestu.

Výjimky

Plně kvalifikovaná cesta a název souboru překračují maximální délku definovanou systémem.

Volající nemá požadované oprávnění.

Příklady

Následující příklad ukazuje FullName vlastnost. Tento příklad kódu je součástí většího příkladu uvedeného pro třídu FileSystemInfo.

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

Poznámky

Například pro soubor c:\NewFile.txt, tato vlastnost vrátí "c:\NewFile.txt".

Seznam běžných vstupně-výstupních úloh najdete v tématu Běžné vstupně-výstupní úlohy.

Platí pro

Viz také