Hinweis
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, sich anzumelden oder das Verzeichnis zu wechseln.
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, das Verzeichnis zu wechseln.
Ruft einen Boolean-Wert ab, der angibt, ob der angegebene Uri ein UNC-Pfad (Universal Naming Convention) ist.
Namespace: System
Assembly: System (in system.dll)
Syntax
'Declaration
Public ReadOnly Property IsUnc As Boolean
'Usage
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
Eigenschaftenwert
true, wenn Uri ein UNC-Pfad ist, andernfalls false.
Ausnahmen
| Ausnahmetyp | Bedingung |
|---|---|
Diese Instanz stellt einen relativen URI dar, diese Eigenschaft ist jedoch nur für absolute URIs gültig. |
Hinweise
Die IsUnc-Eigenschaft ist true, wenn die angegebene Uri-Instanz ein UNC-Pfad ist (z. B. \\server\folder oder file://server/folder). Diese Eigenschaft gibt immer true zurück, wenn der URI das Schema file:// aufweist und eine Hostkomponente angibt.
Beispiel
Im folgenden Beispiel wird eine Uri-Instanz erstellt und bestimmt, ob es sich um einen UNC-Pfad 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