HttpRequest.UserHostAddress プロパティ

定義

リモート クライアントの IP ホスト アドレスを取得します。

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

プロパティ値

String

リモート クライアントの IP アドレス。

次のコード例では、メソッドを HtmlEncode 使用してプロパティの値を UserHostAddress HTML エンコードし、 WriteLine エンコードされた値をファイルに書き込みます。 このコード例は、HttpRequest クラスのために提供されている大規模な例の一部です。

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

適用対象