FileSystemInfo.FullName Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the full path of the directory or 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
Property Value
A string containing the full path.
Exceptions
The fully qualified path and file name exceed the system-defined maximum length.
The caller does not have the required permission.
Examples
The following example demonstrates the FullName property. This code example is part of a larger example provided for the FileSystemInfo class.
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
Remarks
For example, for a file c:\NewFile.txt, this property returns "c:\NewFile.txt".
For a list of common I/O tasks, see Common I/O Tasks.
Applies to
See also
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기