DiscoveryClientProtocol.ReadAll(String) メソッド

定義

保存された探索ドキュメントのマップが格納されているファイルを読み取ります。その探索ドキュメントには、そのファイルが参照している探索ドキュメント、XML スキーマ定義 (XSD) スキーマ、およびサービスの説明を持つ Documents プロパティと References プロパティが読み込まれています。

public:
 System::Web::Services::Discovery::DiscoveryClientResultCollection ^ ReadAll(System::String ^ topLevelFilename);
public System.Web.Services.Discovery.DiscoveryClientResultCollection ReadAll (string topLevelFilename);
member this.ReadAll : string -> System.Web.Services.Discovery.DiscoveryClientResultCollection
Public Function ReadAll (topLevelFilename As String) As DiscoveryClientResultCollection

パラメーター

topLevelFilename
String

読み込む対象となるファイルの名前。このファイルには保存されている探索ドキュメントのマップが格納されています。

戻り値

DiscoveryClientResultCollection

保存されている探索ドキュメントのマップを格納しているファイルで見つかった結果が格納されている DiscoveryClientResultCollection。 ファイル形式は DiscoveryClientProtocol.DiscoveryClientResultsFile クラスで XML にシリアル化されています。ただし、通常は WriteAll(String, String) メソッドまたは Disco.exe だけを使用してファイルを作成します。

次のコード例は、メソッドを使用してReadAll、既存の探索マップ ドキュメントで見つかったドキュメントと参照に関する詳細を A に設定DataGridする Web フォームです。

 protected void Discover_Click(object Source, EventArgs e)
 {
  // Specify the URL to read the discovery results from.
  string outputDirectory = DiscoDir.Text;

      DiscoveryClientProtocol client = new DiscoveryClientProtocol();
  // Use default credentials to access the files containing the discovery results.
      client.Credentials = CredentialCache.DefaultCredentials;

      try {
        DiscoveryDocument doc;
    // Read in existing discovery results.
        DiscoveryClientResultCollection results = client.ReadAll(Path.Combine(DiscoDir.Text,"results.discomap"));
      }
      catch ( Exception e2) 
      {
        DiscoveryResultsGrid.Columns.Clear();
        Status.Text = e2.Message;
      }
  // If discovery documents existed in the supplied folder, display the results in a data grid.
      if (client.Documents.Count > 0)
      PopulateGrid(client);
}
Public Sub Discover_Click(Source As Object, e as EventArgs )
   ' Specify the URL to read the discovery results from.
   Dim outputDirectory As String = DiscoDir.Text

   Dim client as DiscoveryClientProtocol = new DiscoveryClientProtocol()
   ' Use default credentials to access files containing the previously saved discovery results.
   client.Credentials = CredentialCache.DefaultCredentials
   Try 
     Dim doc As DiscoveryDocument
  
    ' Read in existing discovery results.
     Dim results As DiscoveryClientResultCollection 
     results = client.ReadAll(Path.Combine(DiscoDir.Text,"results.discomap"))

   Catch e2 As Exception
       DiscoveryResultsGrid.Columns.Clear()
       Status.Text = e2.Message
   End Try

   ' If disocvery documents existed in the supplied folder, display the results in a data grid.
    If (client.Documents.Count > 0) Then
         ' Populate the data grid with the discovery results.
     PopulateGrid(client)
    End If
End Sub

注釈

保存された探索ドキュメントのマップを含むファイルは、メソッドまたはDisco.exeで WriteAll 作成できます。

ファイルが topLevelFilename 現在のディレクトリに存在しない場合は、パラメーターに完全修飾パスを含める必要があります。

適用対象