RemoteEndpointMessageProperty 類別

定義

讓與傳送訊息之遠端端點關聯的用戶端 IP 位址和連接埠號碼可以使用。Makes available the client IP address and port number associated with the remote endpoint from which a message was sent.

public ref class RemoteEndpointMessageProperty sealed
public sealed class RemoteEndpointMessageProperty
type RemoteEndpointMessageProperty = class
Public NotInheritable Class RemoteEndpointMessageProperty
繼承
RemoteEndpointMessageProperty

備註

屬性會透過 HTTP 和 TCP 傳輸, 加入至 Windows Communication Foundation (WCF) 服務的每個傳入訊息。The property is added to each incoming message to a Windows Communication Foundation (WCF) service through both the HTTP and TCP transports.

該屬性不存在於透過具名管道或 MSMQ 傳輸接收到的訊息上。The property is not present on messages received through either a named pipes or MSMQ transport.

使用裝載於 IIS 的 HTTP 時,此屬性的可用性取決於目前是否有使用中的要求。Availability of the property when using HTTP hosted in IIS depends on having a currently active request. 因此,這個屬性會在要求完成之後無法使用,例如當執行單向接收時。Therefore, this property is not available after the request has completed, such as when performing a one-way receive.

IP 位址和連接埠號碼是接收訊息的節點。The IP address and port number are that of the node from which the message was received. 如果訊息會通過轉送或 Proxy,則各轉送或 Proxy 的 IP 位址和連接埠號碼會由此屬性附加至訊息。If a message goes through a relay or proxy, the IP address and port number of the respective relay or proxy is the one attached to the message by this property.

請注意,由於 IP 位址和連接埠可能會遭到詐騙攻擊,因此除非加入其他應用程式的特定邏輯,否則不應依賴安全性敏感驗證或授權。Be aware that the IP address and port could be spoofed by an attacker and thus should not be relied upon for security sensitive authentication or authorization unless additional application specific logic is added.

建構函式

RemoteEndpointMessageProperty(String, Int32)

針對可識別傳送訊息之來源用戶端的指定 IP 位址和連接埠,初始化 RemoteEndpointMessageProperty 類別的新執行個體。Initializes a new instance of the RemoteEndpointMessageProperty class for a specified IP address and port that identify the client from which the message was sent.

屬性

Address

取得傳送訊息之用戶端的 IP 位址。Gets the IP address of the client from which the message was sent.

Name

傳回字串 "System.ServiceModel.Channels.RemoteEndpointMessageProperty"。Returns the string "System.ServiceModel.Channels.RemoteEndpointMessageProperty".

Port

取得傳送訊息之用戶端的連接埠號碼。Gets the port number of the client from which the message was sent.

方法

Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
GetHashCode()

作為預設雜湊函數。Serves as the default hash function.

(繼承來源 Object)
GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(繼承來源 Object)
ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)

適用於