次の方法で共有


DiscoveryClientProtocol.Download メソッド (String, String)

contentType パラメータを探索ドキュメントの MIME エンコーディングに設定して、指定された URL の探索ドキュメントを Stream オブジェクトにダウンロードします。

Overloads Public Function Download( _
   ByRef url As String, _   ByRef contentType As String _) As Stream
[C#]
public Stream Download(   ref stringurl,   ref stringcontentType);
[C++]
public: Stream* Download(   String** url,   String** contentType);
[JScript]
public function Download(
   url : String,contentType : String) : Stream;

パラメータ

  • url
    ダウンロードする探索ドキュメントの URL。
  • contentType
    ダウンロードする探索ドキュメントの MIME エンコーディング。

戻り値

指定された URL のドキュメントを格納している Stream

例外

例外の種類 条件
WebException 指定した URL からのダウンロードにより、 OK 以外の HTTP ステータス コードが返されました。

使用例

 
Dim myDiscoFile As String = "https://localhost/MathService_vb.vsdisco"
Dim myEncoding As String = ""
Dim myDiscoveryClientProtocol As New DiscoveryClientProtocol()

Dim myStream As Stream = myDiscoveryClientProtocol.Download(myDiscoFile, myEncoding)
Console.WriteLine("The length of the stream in bytes: " & myStream.Length)
Console.WriteLine _
      ("The MIME encoding of the downloaded discovery document: " & myEncoding)
myStream.Close()

[C#] 
string myDiscoFile = "https://localhost/MathService_cs.vsdisco";
string myEncoding = "";
DiscoveryClientProtocol myDiscoveryClientProtocol = 
      new DiscoveryClientProtocol();

Stream myStream = myDiscoveryClientProtocol.Download
      (ref myDiscoFile,ref myEncoding);
Console.WriteLine("The length of the stream in bytes: "+
      myStream.Length);
Console.WriteLine("The MIME encoding of the downloaded "+
      "discovery document: "+ myEncoding);
myStream.Close();

[C++] 
String* myDiscoFile = S"https://localhost/MathService_cs.vsdisco";
String* myEncoding = S"";
DiscoveryClientProtocol* myDiscoveryClientProtocol =
   new DiscoveryClientProtocol();

Stream* myStream = myDiscoveryClientProtocol->Download
   (&myDiscoFile,&myEncoding);
Console::WriteLine(S"The length of the stream in bytes: {0}", __box(myStream->Length));
Console::WriteLine(S"The MIME encoding of the downloaded discovery document: {0}", myEncoding );
myStream->Close();

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

必要条件

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

参照

DiscoveryClientProtocol クラス | DiscoveryClientProtocol メンバ | System.Web.Services.Discovery 名前空間 | DiscoveryClientProtocol.Download オーバーロードの一覧