FileSystemInfo.FullName Właściwość
Ważne
Niektóre informacje odnoszą się do produktu w wersji wstępnej, który może zostać znacząco zmodyfikowany przed wydaniem. Firma Microsoft nie udziela żadnych gwarancji, jawnych lub domniemanych, w odniesieniu do informacji podanych w tym miejscu.
Pobiera pełną ścieżkę katalogu lub pliku.
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
Ciąg zawierający pełną ścieżkę.
W pełni kwalifikowana ścieżka i nazwa pliku przekraczają maksymalną długość zdefiniowaną przez system.
Obiekt wywołujący nie posiada wymaganych uprawnień.
W poniższym przykładzie przedstawiono FullName właściwość . Ten przykład kodu jest częścią większego przykładu podanego FileSystemInfo dla klasy.
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
Na przykład w przypadku c:\NewFile.txt pliku ta właściwość zwraca wartość "c:\NewFile.txt".
Aby uzyskać listę typowych zadań we/wy, zobacz Typowe zadania we/wy.
Produkt | Wersje |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.3, 1.4, 1.6, 2.0, 2.1 |
UWP | 10.0 |
Opinia o produkcie .NET
.NET to projekt typu open source. Wybierz link, aby przekazać opinię: