Binding.Name 属性


获取或设置绑定的名称。Gets or sets the name of the binding.

 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



绑定的名称。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". 不存在基于 Scheme 的固有应用程序或计算机调度。There 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.