HttpRequest.UserHostAddress Özellik

Tanım

Uzak istemcinin IP ana bilgisayar adresini alır.

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

Özellik Değeri

String

Uzak istemcinin IP adresi.

Örnekler

Aşağıdaki kod örneği, özelliğinin HtmlEncode değerini UserHostAddress HTML ile kodlamak için yöntemini ve WriteLine kodlanmış değeri dosyaya yazmak için yöntemini kullanır. Bu kod örneği, sınıfı için HttpRequest sağlanan daha büyük bir örneğin parçasıdır.

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

Şunlara uygulanır