FileSystemInfo.FullName Propriedade
Definição
Obtém o caminho completo do diretório ou arquivo.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
Valor da propriedade
Uma cadeia de caracteres que contém o caminho completo.A string containing the full path.
Exceções
O caminho totalmente qualificado e o nome de arquivo excedem o tamanho máximo definido pelo sistema.The fully qualified path and file name exceed the system-defined maximum length.
O chamador não tem a permissão necessária.The caller does not have the required permission.
Exemplos
O exemplo a seguir demonstra a FullName propriedade.The following example demonstrates the FullName property. Este exemplo de código faz parte de um exemplo maior fornecido para a FileSystemInfo classe.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
Comentários
Por exemplo, para um arquivo c:\NewFile.txt, essa propriedade retorna "c:\NewFile.txt".For example, for a file c:\NewFile.txt, this property returns "c:\NewFile.txt".
Para obter uma lista de tarefas comuns de e/s, consulte tarefas comuns de e/s.For a list of common I/O tasks, see Common I/O Tasks.