次の方法で共有


DiscoveryClientProtocol.Download メソッド (String)

指定された URL の探索ドキュメントを Stream オブジェクトにダウンロードします。

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

パラメータ

  • url
    ダウンロードする探索ドキュメントの URL。

戻り値

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

例外

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

使用例

 
' Call the constructor of the DiscoveryClientProtocol class.
Dim myDiscoveryClientProtocol As New DiscoveryClientProtocol()
myDiscoveryClientProtocol.Credentials = CredentialCache.DefaultCredentials
' 'dataservice.disco' is a sample discovery document.
Dim myStringUrl As String = "https://localhost:80/dataservice.disco"

Dim myStream As Stream = myDiscoveryClientProtocol.Download(myStringUrl)
Console.WriteLine("Size of the discovery document downloaded")
Console.WriteLine("is : {0} bytes", myStream.Length.ToString())
myStream.Close()

[C#] 
// Call the constructor of the DiscoveryClientProtocol class.
DiscoveryClientProtocol myDiscoveryClientProtocol =
            new DiscoveryClientProtocol();
myDiscoveryClientProtocol.Credentials =  CredentialCache.DefaultCredentials;
     // 'dataservice.disco' is a sample discovery document.
     string myStringUrl = "https://localhost:80/dataservice.disco";

Stream myStream = myDiscoveryClientProtocol.Download(ref myStringUrl);

Console.WriteLine("Size of the discovery document downloaded");
Console.WriteLine("is : {0} bytes", myStream.Length.ToString());
myStream.Close();

[C++] 
// Call the constructor of the DiscoveryClientProtocol class.
DiscoveryClientProtocol* myDiscoveryClientProtocol = new DiscoveryClientProtocol();
myDiscoveryClientProtocol->Credentials =  CredentialCache::DefaultCredentials;
// 'dataservice.disco' is a sample discovery document.
String* myStringUrl = S"https://localhost:80/dataservice.disco";

Stream*  myStream = myDiscoveryClientProtocol->Download(&myStringUrl);

Console::WriteLine(S"Size of the discovery document downloaded");
Console::WriteLine(S"is : {0} bytes", __box(myStream->Length));
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 オーバーロードの一覧