다음을 통해 공유


Path.PathSeparator 필드

정의

환경 변수에서 경로 문자열을 구분하는 데 사용되는 플랫폼 특정 구분 문자입니다.

public: static initonly char PathSeparator;
public static readonly char PathSeparator;
 staticval mutable PathSeparator : char
Public Shared ReadOnly PathSeparator As Char 

필드 값

예제

다음 예제에서는 필드의 사용을 보여 줍니다 PathSeparator .

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=:

설명

Windows 기반 데스크톱 플랫폼에서 이 필드의 값은 기본적으로 세미콜론(;)이지만 다른 플랫폼에 따라 다를 수 있습니다.

적용 대상

추가 정보