共用方式為


ServiceDescriptionCollection.GetBinding(XmlQualifiedName) 方法

定義

搜尋 ServiceDescriptionCollection 並傳回具有指定名稱的 Binding,其為包含在集合中的其中一個 ServiceDescription 執行個體的成員。

public:
 System::Web::Services::Description::Binding ^ GetBinding(System::Xml::XmlQualifiedName ^ name);
public System.Web.Services.Description.Binding GetBinding (System.Xml.XmlQualifiedName name);
member this.GetBinding : System.Xml.XmlQualifiedName -> System.Web.Services.Description.Binding
Public Function GetBinding (name As XmlQualifiedName) As Binding

參數

name
XmlQualifiedName

XmlQualifiedName,其 Name 屬性用於擷取 Binding 執行個體。

傳回

Binding

具有指定名稱的繫結。

例外狀況

指定的 Binding 不是集合內任何 ServiceDescription 執行個體的成員。

範例

// Construct an XML qualified name.
XmlQualifiedName^ myXmlQualifiedName =
   gcnew XmlQualifiedName( "MathServiceSoap","http://tempuri2.org/" );

// Get the Binding from the collection.
myCollection->GetBinding( myXmlQualifiedName );
// Construct an XML qualified name.
XmlQualifiedName myXmlQualifiedName =
   new XmlQualifiedName("MathServiceSoap", "http://tempuri2.org/");

// Get the Binding from the collection.
Binding myBinding = myCollection.GetBinding(myXmlQualifiedName);
' Construct an XML qualified name.
Dim myXmlQualifiedName As _
   New XmlQualifiedName("MathServiceSoap", "http://tempuri2.org/")

' Get the Binding from the collection.
Dim myBinding As Binding = _
   myCollection.GetBinding(myXmlQualifiedName)

適用於