Freigeben über


DiscoveryClientReferenceCollection.Keys-Eigenschaft

Ruft ein System.Collections.ICollection-Objekt mit allen Schlüsseln aus der DiscoveryClientReferenceCollection ab.

Namespace: System.Web.Services.Discovery
Assembly: System.Web.Services (in system.web.services.dll)

Syntax

'Declaration
Public ReadOnly Property Keys As ICollection
'Usage
Dim instance As DiscoveryClientReferenceCollection
Dim value As ICollection

value = instance.Keys
public ICollection Keys { get; }
public:
property ICollection^ Keys {
    ICollection^ get ();
}
/** @property */
public ICollection get_Keys ()
public function get Keys () : ICollection

Eigenschaftenwert

Eine ICollection, die die Schlüssel der DiscoveryClientReferenceCollection enthält.

Beispiel

Dim myDiscoveryClientProtocol As New DiscoveryClientProtocol()
myDiscoveryClientProtocol.Credentials = _
    CredentialCache.DefaultCredentials

' 'dataservice.disco' is a sample discovery document.
Dim myStringUrl As String = "https://localhost/dataservice.disco"

' Call the Discover method to populate the References property.
Dim myDiscoveryDocument As DiscoveryDocument = _
    myDiscoveryClientProtocol.Discover(myStringUrl)

' Resolve all references found in the discovery document.
myDiscoveryClientProtocol.ResolveAll()
Dim myDiscoveryClientReferenceCollection As DiscoveryClientReferenceCollection = _
    myDiscoveryClientProtocol.References

' Retrieve the keys in the collection.
Dim myCollection As ICollection = myDiscoveryClientReferenceCollection.Keys
Dim myObjectCollection(myDiscoveryClientReferenceCollection.Count) As Object
myCollection.CopyTo(myObjectCollection, 0)

Console.WriteLine("The discovery documents, service descriptions, and XML schema")
Console.WriteLine(" definitions in the collection are:")
Dim iIndex As Integer
For iIndex = 0 To myObjectCollection.Length - 1
    Console.WriteLine(myObjectCollection(iIndex))
Next iIndex
DiscoveryClientProtocol myDiscoveryClientProtocol =
    new DiscoveryClientProtocol();
myDiscoveryClientProtocol.Credentials =  
    CredentialCache.DefaultCredentials;

// 'dataservice.disco' is a sample discovery document.
string myStringUrl = "https://localhost/dataservice.disco";

// Call the Discover method to populate the References property.
DiscoveryDocument myDiscoveryDocument = 
    myDiscoveryClientProtocol.Discover(myStringUrl);

// Resolve all references found in the discovery document.
myDiscoveryClientProtocol.ResolveAll();
DiscoveryClientReferenceCollection myDiscoveryClientReferenceCollection = 
    myDiscoveryClientProtocol.References;

// Retrieve the keys in the collection.
ICollection myCollection = myDiscoveryClientReferenceCollection.Keys;
object[] myObjectCollection = 
    new object[myDiscoveryClientReferenceCollection.Count];
myCollection.CopyTo(myObjectCollection, 0);
Console.WriteLine("The discovery documents, service descriptions, and XML schema");
Console.WriteLine(" definitions in the collection are:");
for (int iIndex=0; iIndex < myObjectCollection.Length; iIndex++)
{
    Console.WriteLine(myObjectCollection[iIndex]);
}
DiscoveryClientProtocol^ myDiscoveryClientProtocol = gcnew DiscoveryClientProtocol;
myDiscoveryClientProtocol->Credentials = CredentialCache::DefaultCredentials;

// 'dataservice.disco' is a sample discovery document.
String^ myStringUrl = "https://localhost/dataservice.disco";

// Call the Discover method to populate the References property.
DiscoveryDocument^ myDiscoveryDocument = myDiscoveryClientProtocol->Discover( myStringUrl );

// Resolve all references found in the discovery document.
myDiscoveryClientProtocol->ResolveAll();
DiscoveryClientReferenceCollection^ myDiscoveryClientReferenceCollection = myDiscoveryClientProtocol->References;

// Retrieve the keys in the collection.
ICollection^ myCollection = myDiscoveryClientReferenceCollection->Keys;
array<Object^>^myObjectCollection = gcnew array<Object^>(myDiscoveryClientReferenceCollection->Count);
myCollection->CopyTo( myObjectCollection, 0 );
Console::WriteLine( "The discovery documents, service descriptions, and XML schema" );
Console::WriteLine( " definitions in the collection are:" );
for ( int iIndex = 0; iIndex < myObjectCollection->Length; iIndex++ )
{
   Console::WriteLine( myObjectCollection[ iIndex ] );
}

Plattformen

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.

Versionsinformationen

.NET Framework

Unterstützt in: 2.0, 1.1, 1.0

Siehe auch

Referenz

DiscoveryClientReferenceCollection-Klasse
DiscoveryClientReferenceCollection-Member
System.Web.Services.Discovery-Namespace