Binding.Name 屬性

定義

取得或設定繫結的名稱。Gets or sets the name of the binding.

public:
 property System::String ^ Name { System::String ^ get(); void set(System::String ^ value); };
public string Name { get; set; }
member this.Name : string with get, set
Public Property Name As String

屬性值

String

繫結的名稱。The name of the binding. 預設名稱為 nullThe default name is null.

例外狀況

設定的值不能是 null 或空字串。The value set cannot be null or an empty string.

備註

Binding 的每個執行個體都具有 NameNamespace,這兩者可一起在服務的中繼資料內唯一識別繫結的使用者名稱。Each instance of a Binding has a Name and Namespace that together uniquely identify the user name for the binding in the metadata of the service.

繫結的這個使用者名稱與通訊協定名稱的規格不同,後者是由 Scheme 屬性所指定。This user name for the binding is distinct from the specification of the protocol name, which is specified by the Scheme property. 例如,如果您要新增更多 HTTP 繫結,您可以任意命名,並將其所有配置設定為 "http"。If you want to add more HTTP bindings, for example, you can name them whatever you want and set all of their schemes to "http". 沒有任何原有應用程式或機器分派是根據 SchemeThere is no inherent application or machine dispatch based on the Scheme. 因此,您可以避開無法為已知通訊協定註冊其他處理常式的常見問題。So you avoid the common problem of being unable to register additional handlers for well-known protocols. 您也可以輕鬆地並存使用多個版本的繫結,只需要為每一個版本提供不同的名稱即可。You can also easily work with multiple versions of a binding side-by-side by giving each version a different name.

適用於