Freigeben über


Uri.IsDefaultPort-Eigenschaft

Ruft einen Wert ab, der angibt, ob der Anschluss im URI der Standardwert für dieses Schema ist.

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

Syntax

'Declaration
Public ReadOnly Property IsDefaultPort As Boolean
'Usage
Dim instance As Uri
Dim value As Boolean

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

Eigenschaftenwert

true, wenn der Wert der Port-Eigenschaft der Standardanschluss für dieses Schema ist, andernfalls false.

Beispiel

Im folgenden Beispiel wird eine Uri-Instanz erstellt und überprüft, ob sie den Standardanschluss verwendet.

' Create Uri
Dim uriAddress As New Uri("https://www.contoso.com/index.htm#search")
Console.WriteLine(uriAddress.Fragment)
Console.WriteLine("Uri {0} the default port ", IIf(uriAddress.IsDefaultPort, "uses", "does not use")) 'TODO: For performance reasons this should be changed to nested IF statements

Console.WriteLine("The path of this Uri is {0}", uriAddress.GetLeftPart(UriPartial.Path))
Console.WriteLine("Hash code {0}", uriAddress.GetHashCode())
// Create Uri
Uri uriAddress = new Uri("https://www.contoso.com/index.htm#search");
Console.WriteLine(uriAddress.Fragment);
Console.WriteLine("Uri {0} the default port ", uriAddress.IsDefaultPort ? "uses" : "does not use");
 
Console.WriteLine("The path of this Uri is {0}", uriAddress.GetLeftPart(UriPartial.Path));
Console.WriteLine("Hash code {0}", uriAddress.GetHashCode());

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