Share via


UserHostName Property

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Gets the DNS name and, if provided, the port number specified by the client.

Namespace:  System.Net
Assembly:  System.Http (in System.Http.dll)

Syntax

'Declaration
Public ReadOnly Property UserHostName As String
public string UserHostName { get; }
public:
property String^ UserHostName {
    String^ get ();
}
member UserHostName : string with get
function get UserHostName () : String

Property Value

Type: System. . :: . .String
A String value that contains the text of the request's Host header.

Remarks

The Host header contains the requested server host name and port number, if specified, separated by a colon (for example, www.contoso.com:8080).

You can use this property to return different responses depending on the host name specified in the request.

For a complete list of request headers, see the HttpRequestHeader enumeration.

.NET Framework Security

See Also

Reference

HttpListenerRequest Class

System.Net Namespace