다음을 통해 공유


Uri.IsFile 속성

지정된 Uri가 파일 URI인지 여부를 나타내는 값을 가져옵니다.

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

구문

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

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

속성 값

Uri가 파일 URI이면 true이고, 그렇지 않으면 false입니다.

설명

Scheme 속성이 UriSchemeFile과 같으면 IsFile 속성은 true입니다.

예제

다음 예제에서는 Uri 인스턴스를 만들고 이 인스턴스가 파일 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 네임스페이스