다음을 통해 공유


Uri.IsUnc 속성

지정된 Uri가 UNC(Universal Naming Convention) 경로인지 여부를 나타내는 Boolean 값을 가져옵니다.

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

구문

‘선언
Public ReadOnly Property IsUnc As Boolean
‘사용 방법
Dim instance As Uri
Dim value As Boolean

value = instance.IsUnc
public bool IsUnc { get; }
public:
property bool IsUnc {
    bool get ();
}
/** @property */
public boolean get_IsUnc ()
public function get IsUnc () : boolean

속성 값

Uri가 UNC 경로이면 true이고, 그렇지 않으면 false입니다.

예외

예외 형식 조건

InvalidOperationException

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

설명

지정된 Uri 인스턴스가 \\server\folder 또는 file://server/folder와 같은 UNC 경로인 경우 IsUnc 속성은 true입니다. URI에 file:// 체계가 있고 호스트 구성 요소가 지정되어 있으면 이 속성은 항상 true를 반환합니다.

예제

다음 예제에서는 Uri 인스턴스를 만들고 이 인스턴스가 UNC 경로인지 여부를 확인합니다.

    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 네임스페이스