Freigeben über


Uri.IsFile-Eigenschaft

Ruft einen Wert ab, der angibt, ob der angegebene Uri ein Datei-URI ist.

Namespace: System
Assembly: System (in system.dll)

Syntax

'Declaration
Public ReadOnly Property IsFile As Boolean
'Usage
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

Eigenschaftenwert

true, wenn Uri ein Datei-URI ist, andernfalls false.

Hinweise

Die IsFile-Eigenschaft ist true, wenn die Scheme-Eigenschaft gleich UriSchemeFile ist.

Beispiel

Im folgenden Beispiel wird eine Uri-Instanz erstellt und bestimmt, ob es sich um einen Datei-URI handelt.

    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");

Plattformen

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

.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.

Versionsinformationen

.NET Framework

Unterstützt in: 2.0, 1.1, 1.0

.NET Compact Framework

Unterstützt in: 2.0, 1.0

Siehe auch

Referenz

Uri-Klasse
Uri-Member
System-Namespace