HttpRequest.UserHostName HttpRequest.UserHostName HttpRequest.UserHostName HttpRequest.UserHostName Property

定義

取得遠端用戶端的 DNS 名稱。Gets the DNS name of the remote client.

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

屬性值

遠端用戶端的 DNS 名稱。The DNS name of the remote client.

範例

下列程式碼範例會使用HtmlEncode方法,以 HTML 編碼的值UserHostName屬性和WriteLine方法來寫入檔案的編碼的值。The following code example uses the HtmlEncode method to HTML-encode the value of the UserHostName property and the WriteLine method to write the encoded value to the file. 此程式碼範例是針對提供之較大範例的一部分HttpRequest類別。This code example is part of a larger example provided for the HttpRequest class.

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

適用於