HttpRequest.UserHostAddress Eigenschaft

Definition

Ruft die IP-Hostadresse des Remoteclients ab.

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

Eigenschaftswert

Die IP-Adresse des Remoteclients.

Beispiele

Im folgenden Codebeispiel wird die HtmlEncode -Methode zum HTML-Codieren des Werts der UserHostAddress -Eigenschaft und der WriteLine -Methode verwendet, um den codierten Wert in die Datei zu schreiben. Dieses Codebeispiel ist Teil eines größeren Beispiels, das für die HttpRequest-Klasse bereitgestellt wird.

// 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))

Gilt für: