Path.PathSeparator Champ
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Caractère de séparation spécifique à la plateforme, utilisé pour séparer les chaînes de chemin d'accès dans les variables d'environnement.
public: static initonly char PathSeparator;
public static readonly char PathSeparator;
staticval mutable PathSeparator : char
Public Shared ReadOnly PathSeparator As Char
Valeur de champ
Exemples
L’exemple suivant illustre l’utilisation du PathSeparator
champ.
Console::WriteLine( "Path::AltDirectorySeparatorChar={0}", (Path::AltDirectorySeparatorChar).ToString() );
Console::WriteLine( "Path::DirectorySeparatorChar={0}", (Path::DirectorySeparatorChar).ToString() );
Console::WriteLine( "Path::PathSeparator={0}", (Path::PathSeparator).ToString() );
Console::WriteLine( "Path::VolumeSeparatorChar={0}", (Path::VolumeSeparatorChar).ToString() );
Console::Write( "Path::InvalidPathChars=" );
for ( int i = 0; i < Path::InvalidPathChars->Length; i++ )
Console::Write( Path::InvalidPathChars[ i ] );
Console::WriteLine();
// This code produces output similar to the following:
// Note that the InvalidPathCharacters contain characters
// outside of the printable character set.
//
// Path.AltDirectorySeparatorChar=/
// Path.DirectorySeparatorChar=\
// Path.PathSeparator=;
// Path.VolumeSeparatorChar=:
Console.WriteLine("Path.AltDirectorySeparatorChar={0}",
Path.AltDirectorySeparatorChar);
Console.WriteLine("Path.DirectorySeparatorChar={0}",
Path.DirectorySeparatorChar);
Console.WriteLine("Path.PathSeparator={0}",
Path.PathSeparator);
Console.WriteLine("Path.VolumeSeparatorChar={0}",
Path.VolumeSeparatorChar);
Console.Write("Path.GetInvalidPathChars()=");
foreach (char c in Path.GetInvalidPathChars())
Console.Write(c);
Console.WriteLine();
// This code produces output similar to the following:
// Note that the InvalidPathCharacters contain characters
// outside of the printable character set.
//
// Path.AltDirectorySeparatorChar=/
// Path.DirectorySeparatorChar=\
// Path.PathSeparator=;
// Path.VolumeSeparatorChar=:
Console.WriteLine("Path.AltDirectorySeparatorChar={0}", Path.AltDirectorySeparatorChar)
Console.WriteLine("Path.DirectorySeparatorChar={0}", Path.DirectorySeparatorChar)
Console.WriteLine("Path.PathSeparator={0}", Path.PathSeparator)
Console.WriteLine("Path.VolumeSeparatorChar={0}", Path.VolumeSeparatorChar)
Console.Write("Path.GetInvalidPathChars()=")
Dim c As Char
For Each c In Path.GetInvalidPathChars()
Console.Write(c)
Next c
Console.WriteLine()
' This code produces output similar to the following:
' Note that the InvalidPathCharacters contain characters
' outside of the printable character set.
'
' Path.AltDirectorySeparatorChar=/
' Path.DirectorySeparatorChar=\
' Path.PathSeparator=;
' Path.VolumeSeparatorChar=:
Remarques
Sur les plateformes de bureau Windows, la valeur de ce champ est le point-virgule (;) par défaut, mais peut varier sur d’autres plateformes.