DiscoveryClientReferenceCollection.Item[String] 属性

定义

在具有指定 URL 的 DiscoveryReference 中获取或设置一个 DiscoveryClientReferenceCollection 对象。

public:
 property System::Web::Services::Discovery::DiscoveryReference ^ default[System::String ^] { System::Web::Services::Discovery::DiscoveryReference ^ get(System::String ^ url); void set(System::String ^ url, System::Web::Services::Discovery::DiscoveryReference ^ value); };
public System.Web.Services.Discovery.DiscoveryReference this[string url] { get; set; }
member this.Item(string) : System.Web.Services.Discovery.DiscoveryReference with get, set
Default Public Property Item(url As String) As DiscoveryReference

参数

url
String

要在 DiscoveryReference 中获取或设置的 DiscoveryClientReferenceCollection 的 URL。

属性值

DiscoveryReference

一个 DiscoveryReference,它表示对发现文档的引用。

示例

DiscoveryClientReferenceCollection^ myDiscoveryClientReferenceCollection = gcnew DiscoveryClientReferenceCollection;
ContractReference^ myContractReference = gcnew ContractReference;
String^ myStringUrl1 = "http://www.contoso.com/service1.disco";
myContractReference->Ref = myStringUrl1;
myDiscoveryClientReferenceCollection->Add( myContractReference );

// myDiscoveryClientReferenceCollection is an instance collection.
Object^ myObject = myDiscoveryClientReferenceCollection[ myStringUrl1 ];
Console::WriteLine( "Object representing the URL: {0}", myObject );
DiscoveryClientReferenceCollection myDiscoveryClientReferenceCollection =
    new DiscoveryClientReferenceCollection();

ContractReference myContractReference = new ContractReference();
string myStringUrl1 = "http://www.contoso.com/service1.disco";
myContractReference.Ref = myStringUrl1;
myDiscoveryClientReferenceCollection.Add(myContractReference);

// myDiscoveryClientReferenceCollection is an instance collection.
object myObject = myDiscoveryClientReferenceCollection[myStringUrl1];
Console.WriteLine("Object representing the URL: " + myObject.ToString());

Dim myDiscoveryClientReferenceCollection As _
    New DiscoveryClientReferenceCollection()

Dim myContractReference As New ContractReference()
Dim myStringUrl1 As String = "http://www.contoso.com/service1.disco"
myContractReference.Ref = myStringUrl1
myDiscoveryClientReferenceCollection.Add(myContractReference)
' myDiscoveryClientReferenceCollection is an instance collection.
Dim myObject As Object = _
    myDiscoveryClientReferenceCollection.Item(myStringUrl1)
Console.WriteLine("Object representing the URL: " + myObject.ToString())

适用于