共用方式為


ServiceEndpoint.Address 屬性

定義

取得或設定服務端點的端點位址。

public:
 property System::ServiceModel::EndpointAddress ^ Address { System::ServiceModel::EndpointAddress ^ get(); void set(System::ServiceModel::EndpointAddress ^ value); };
public System.ServiceModel.EndpointAddress Address { get; set; }
member this.Address : System.ServiceModel.EndpointAddress with get, set
Public Property Address As EndpointAddress

屬性值

EndpointAddress

指定服務端點的位置的 EndpointAddress

範例

下列範例將示範如何將 ServiceEndpoint 加入至現有的 ServiceHost 並顯示位址屬性:

ServiceEndpoint endpnt = serviceHost.AddServiceEndpoint(
    typeof(ICalculator),
    new WSHttpBinding(),
    "CalculatorServiceObject");

Console.WriteLine("Address: {0}", endpnt.Address);
Dim endpnt As ServiceEndpoint = serviceHost.AddServiceEndpoint(GetType(ICalculator), New WSHttpBinding(), "CalculatorServiceObject")

Console.WriteLine("Address: {0}", endpnt.Address)

備註

服務端點接聽的 ListenUri 的預設值是由 Uri 傳回的 EndpointAddressAddress 所提供。

適用於