Condividi tramite


HttpRequest.UserHostName Proprietà

Definizione

Ottiene il nome DNS del client remoto.

public:
 property System::String ^ UserHostName { System::String ^ get(); };
public string UserHostName { get; }
member this.UserHostName : string
Public ReadOnly Property UserHostName As String

Valore della proprietà

Nome DNS del client remoto.

Esempio

Nell'esempio di codice seguente viene utilizzato il HtmlEncode metodo per codificare html il valore della UserHostName proprietà e il WriteLine metodo per scrivere il valore codificato nel file. Questo esempio di codice fa parte di un esempio più ampio fornito per la HttpRequest classe .

// Write request information to the file with HTML encoding.
sw.WriteLine(Server.HtmlEncode(Request.RequestType));
sw.WriteLine(Server.HtmlEncode(Request.UserHostAddress));
sw.WriteLine(Server.HtmlEncode(Request.UserHostName));
sw.WriteLine(Server.HtmlEncode(Request.HttpMethod));
' Write request information to the file with HTML encoding.
sw.WriteLine(Server.HtmlEncode(Request.RequestType))
sw.WriteLine(Server.HtmlEncode(Request.UserHostAddress))
sw.WriteLine(Server.HtmlEncode(Request.UserHostName))
sw.WriteLine(Server.HtmlEncode(Request.HttpMethod))

Si applica a