Share via


FileSystemInfo.FullName Properti

Definisi

Mendapatkan jalur lengkap direktori atau file.

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

Nilai Properti

String yang berisi jalur lengkap.

Pengecualian

Jalur dan nama file yang sepenuhnya memenuhi syarat melebihi panjang maksimum yang ditentukan sistem.

Pemanggil tidak memiliki izin yang diperlukan.

Contoh

Contoh berikut menunjukkan FullName properti . Contoh kode ini adalah bagian dari contoh yang lebih besar yang disediakan untuk FileSystemInfo kelas .

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

Keterangan

Misalnya, untuk c:\NewFile.txt file, properti ini mengembalikan "c:\NewFile.txt".

Untuk daftar tugas I/O umum, lihat Tugas I/O Umum.

Berlaku untuk

Lihat juga