Поделиться через


HostString Structure

 

Represents the host portion of a Uri can be used to construct Uri's properly formatted and encoded for use in HTTP headers.

Namespace:   Microsoft.Owin
Assembly:  Microsoft.Owin (in Microsoft.Owin.dll)

Syntax

public struct HostString : IEquatable<HostString>
public value struct HostString : IEquatable<HostString>
[<Sealed>]
type HostString = 
    struct
        interface IEquatable<HostString>
    end
Public Structure HostString
    Implements IEquatable(Of HostString)

Constructors

Name Description
System_CAPS_pubmethod HostString(String)

Creates a new HostString without modification. The value should be Unicode rather than punycode, and may have a port. IPv4 and IPv6 addresses are also allowed, and also may have ports.

Properties

Name Description
System_CAPS_pubproperty Value

Returns the original value from the constructor.

Methods

Name Description
System_CAPS_pubmethod Equals(HostString)

Compares the equality of the Value property, ignoring case.

System_CAPS_pubmethod Equals(Object)

Compares against the given object only if it is a HostString.(Overrides ValueType.Equals(Object).)

System_CAPS_pubmethodSystem_CAPS_static FromUriComponent(String)

Creates a new HostString from the given uri component. Any punycode will be converted to Unicode.

System_CAPS_pubmethodSystem_CAPS_static FromUriComponent(Uri)

Creates a new HostString from the host and port of the give Uri instance. Punycode will be converted to Unicode.

System_CAPS_pubmethod GetHashCode()

Gets a hash code for the value.(Overrides ValueType.GetHashCode().)

System_CAPS_pubmethod GetType()

(Inherited from Object.)

System_CAPS_pubmethod ToString()

Returns the value as normalized by ToUriComponent().(Overrides ValueType.ToString().)

System_CAPS_pubmethod ToUriComponent()

Returns the value properly formatted and encoded for use in a URI in a HTTP header. Any Unicode is converted to punycode. IPv6 addresses will have brackets added if they are missing.

Operators

Name Description
System_CAPS_puboperatorSystem_CAPS_static Equality(HostString, HostString)

Compares the two instances for equality.

System_CAPS_puboperatorSystem_CAPS_static Inequality(HostString, HostString)

Compares the two instances for inequality.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Microsoft.Owin Namespace

Return to top