다음을 통해 공유


Uri.LocalPath 속성

파일 이름에 대한 로컬 운영 체제 표현을 가져옵니다.

네임스페이스: System
어셈블리: System(system.dll)

구문

‘선언
Public ReadOnly Property LocalPath As String
‘사용 방법
Dim instance As Uri
Dim value As String

value = instance.LocalPath
public string LocalPath { get; }
public:
property String^ LocalPath {
    String^ get ();
}
/** @property */
public String get_LocalPath ()
public function get LocalPath () : String

속성 값

파일 이름에 대한 로컬 운영 체제 표현이 포함된 String입니다.

예외

예외 형식 조건

InvalidOperationException

이 인스턴스가 상대 URI를 나타내고 이 속성이 절대 URI에만 유효한 경우

설명

이 속성에서 반환하는 값은 이스케이프되어 있지 않습니다. 경로가 Windows 파일 경로로 인식되면 모든 슬래시(/)가 백슬래시(\)로 대체됩니다.

file://computer/file.ext URI의 경우 절대 경로는 /file.ext이고 로컬 경로는 \\computer\file.ext입니다.

예제

다음 예제에서는 Uri 인스턴스를 만들고 로컬 경로를 콘솔에 씁니다.

    Dim uriAddress2 As New Uri("file://server/filename.ext")
    Console.WriteLine(uriAddress2.LocalPath)
    Console.WriteLine("Uri {0} a UNC path", IIf(uriAddress2.IsUnc, "is", "is not")) 'TODO: For performance reasons this should be changed to nested IF statements
    Console.WriteLine("Uri {0} a local host", IIf(uriAddress2.IsLoopback, "is", "is not")) 'TODO: For performance reasons this should be changed to nested IF statements
    Console.WriteLine("Uri {0} a file", IIf(uriAddress2.IsFile, "is", "is not")) 'TODO: For performance reasons this should be changed to nested IF statements

End Sub 'GetParts
Uri uriAddress2 =  new Uri("file://server/filename.ext");
Console.WriteLine(uriAddress2.LocalPath);
Console.WriteLine("Uri {0} a UNC path", uriAddress2.IsUnc ? "is" : "is not");
Console.WriteLine("Uri {0} a local host", uriAddress2.IsLoopback ? "is" : "is not");
Console.WriteLine("Uri {0} a file", uriAddress2.IsFile ? "is" : "is not");

플랫폼

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework에서 모든 플래폼의 모든 버전을 지원하지는 않습니다. 지원되는 버전의 목록은 시스템 요구 사항을 참조하십시오.

버전 정보

.NET Framework

2.0, 1.1, 1.0에서 지원

.NET Compact Framework

2.0, 1.0에서 지원

참고 항목

참조

Uri 클래스
Uri 멤버
System 네임스페이스