次の方法で共有


DiscoveryClientResult クラス

参照されるドキュメントの内容を除く、探索された参照の詳細を表します。このクラスは継承できません。

この型のすべてのメンバの一覧については、DiscoveryClientResult メンバ を参照してください。

System.Object
   System.Web.Services.Discovery.DiscoveryClientResult

NotInheritable Public Class DiscoveryClientResult
[C#]
public sealed class DiscoveryClientResult
[C++]
public __gc __sealed class DiscoveryClientResult
[JScript]
public class DiscoveryClientResult

スレッドセーフ

この型の public static (Visual Basicでは Shared) のすべてのメンバは、マルチスレッド操作で安全に使用できます。インスタンスのメンバの場合は、スレッドセーフであるとは限りません。

解説

DiscoveryClientProtocolWriteAll メソッドを使用すると、すべての有効な参照されるドキュメント、および保存されているすべてのドキュメントのマップが格納されているファイルを、ディスクに書き込むことができます。保存されているすべてのドキュメントのマップが格納されているファイルには、 DiscoveryClientResult プロパティでまとめられた各ドキュメントの詳細が含まれています。

WriteAll メソッドを使用して参照されるドキュメントおよび参照されるドキュメントのマップをディスクに書き込んだ後で、 ReadAll メソッドを呼び出して探索ドキュメントを読み取ることができます。

使用例

 
Imports System
Imports System.Web.Services.Discovery

Public Class MyDiscoveryClientResult

    Shared Sub Main()
        Try
            Dim myDiscoveryClientProtocol As New DiscoveryClientProtocol()

            ' Get the collection holding DiscoveryClientResult objects.
            Dim myDiscoveryClientResultCollection As _
                DiscoveryClientResultCollection = _
                myDiscoveryClientProtocol.ReadAll("results.discomap")
            Console.WriteLine("The number of DiscoveryClientResult objects: " _
                & myDiscoveryClientResultCollection.Count.ToString())
            Console.WriteLine("Displaying the items in the collection:")

            ' Iterate through the collection and display the properties
            ' of each DiscoveryClientResult in it.
            Dim myDiscoveryClientResult As DiscoveryClientResult
            For Each myDiscoveryClientResult In myDiscoveryClientResultCollection
                Console.WriteLine( _
                    "Type of reference in the discovery document: " _
                    & myDiscoveryClientResult.ReferenceTypeName)
                Console.WriteLine("Url for the reference: " _
                    & myDiscoveryClientResult.Url)
                Console.WriteLine("File for saving the reference: " _
                    & myDiscoveryClientResult.Filename)
            Next myDiscoveryClientResult
        Catch e As Exception
            Console.WriteLine("Error is " + e.Message)
        End Try
    End Sub 'Main
End Class 'MyDiscoveryClientResult

[C#] 
using System;
using System.Web.Services.Discovery;
public class MyDiscoveryClientResult
{
    static void Main()
    {
        try
        {
            DiscoveryClientProtocol myDiscoveryClientProtocol = 
                new DiscoveryClientProtocol();

            // Get the collection holding DiscoveryClientResult objects.
            DiscoveryClientResultCollection myDiscoveryClientResultCollection = 
                myDiscoveryClientProtocol.ReadAll("results.discomap");
            Console.WriteLine("The number of DiscoveryClientResult objects: "
                + myDiscoveryClientResultCollection.Count);
            Console.WriteLine("Displaying the items in the collection:");

            // Iterate through the collection and display the properties
            // of each DiscoveryClientResult in it.
            foreach(DiscoveryClientResult myDiscoveryClientResult in 
                myDiscoveryClientResultCollection)
            {
                Console.WriteLine(
                    "Type of reference in the discovery document: "
                    + myDiscoveryClientResult.ReferenceTypeName);
                Console.WriteLine("Url for the reference: " 
                    + myDiscoveryClientResult.Url);
                Console.WriteLine("File for saving the reference: "
                    + myDiscoveryClientResult.Filename);
            }
        }
        catch(Exception e)
        {
            Console.WriteLine("Error is " + e.Message);
        }
    }
}

[C++] 
#using <mscorlib.dll>
#using <System.Web.Services.dll>
#using <System.dll>
using namespace System;
using namespace System::Web::Services::Discovery;

int main()
{
   try
   {
      DiscoveryClientProtocol* myDiscoveryClientProtocol =
         new DiscoveryClientProtocol();

      // Get the collection holding DiscoveryClientResult objects.
      DiscoveryClientResultCollection* myDiscoveryClientResultCollection =
         myDiscoveryClientProtocol->ReadAll(S"results.discomap");
      Console::WriteLine(S"The number of DiscoveryClientResult objects: {0}", __box(myDiscoveryClientResultCollection->Count));
      Console::WriteLine(S"Displaying the items in the collection:");

      // Iterate through the collection and display the properties
      // of each DiscoveryClientResult in it.
      System::Collections::IEnumerator* myEnum = myDiscoveryClientResultCollection->GetEnumerator();
      while (myEnum->MoveNext())
      {
         DiscoveryClientResult* myDiscoveryClientResult = __try_cast<DiscoveryClientResult*>(myEnum->Current);
         Console::WriteLine(
            S"Type of reference in the discovery document: {0}", myDiscoveryClientResult->ReferenceTypeName);
         Console::WriteLine(S"Url for the reference: {0}", myDiscoveryClientResult->Url);
         Console::WriteLine(S"File for saving the reference: {0}", myDiscoveryClientResult->Filename);
      }
   }
   catch(Exception* e)
   {
      Console::WriteLine(S"Error is {0}", e->Message);
   }
}

[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

必要条件

名前空間: System.Web.Services.Discovery

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ

アセンブリ: System.Web.Services (System.Web.Services.dll 内)

参照

DiscoveryClientResult メンバ | System.Web.Services.Discovery 名前空間