DiscoveryClientProtocol.Download 메서드

정의

제공된 URL의 검색 문서를 개체에 Stream 다운로드합니다.

오버로드

Name Description
Download(String)

제공된 URL의 검색 문서를 개체에 Stream 다운로드합니다.

Download(String, String)

제공된 URL의 검색 문서를 개체에 다운로드하여 Stream 매개 변수를 검색 문서의 MIME 인코딩으로 설정합니다 contentType .

Download(String)

제공된 URL의 검색 문서를 개체에 Stream 다운로드합니다.

public:
 System::IO::Stream ^ Download(System::String ^ % url);
public System.IO.Stream Download(ref string url);
member this.Download : string -> System.IO.Stream
Public Function Download (ByRef url As String) As Stream

매개 변수

url
String

다운로드할 검색 문서의 URL입니다.

반품

Stream 제공된 URL에 문서가 포함된 항목입니다.

예외

제공된 URL에서 다운로드하면 HTTP 상태 코드가 반환되었습니다 OK.

예제

// Call the constructor of the DiscoveryClientProtocol class.
DiscoveryClientProtocol^ myDiscoveryClientProtocol =
   gcnew DiscoveryClientProtocol;
myDiscoveryClientProtocol->Credentials = CredentialCache::DefaultCredentials;
// 'dataservice.disco' is a sample discovery document.
String^ myStringUrl = "http://localhost:80/dataservice.disco";

Stream^ myStream = myDiscoveryClientProtocol->Download( myStringUrl );

Console::WriteLine( "Size of the discovery document downloaded" );
Console::WriteLine( "is : {0} bytes", myStream->Length );
myStream->Close();
 // Call the constructor of the DiscoveryClientProtocol class.
 DiscoveryClientProtocol myDiscoveryClientProtocol =
             new DiscoveryClientProtocol();
 myDiscoveryClientProtocol.Credentials =  CredentialCache.DefaultCredentials;
// 'dataservice.disco' is a sample discovery document.
string myStringUrl = "http://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();
' 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 = "http://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()

적용 대상

Download(String, String)

제공된 URL의 검색 문서를 개체에 다운로드하여 Stream 매개 변수를 검색 문서의 MIME 인코딩으로 설정합니다 contentType .

public:
 System::IO::Stream ^ Download(System::String ^ % url, System::String ^ % contentType);
public System.IO.Stream Download(ref string url, ref string contentType);
member this.Download : string * string -> System.IO.Stream
Public Function Download (ByRef url As String, ByRef contentType As String) As Stream

매개 변수

url
String

다운로드할 검색 문서의 URL입니다.

contentType
String

다운로드한 검색 문서의 MIME 인코딩입니다.

반품

Stream 제공된 URL에 문서가 포함된 항목입니다.

예외

제공된 URL에서 다운로드하면 HTTP 상태 코드가 반환되었습니다 OK.

예제

String^ myDiscoFile = "http://localhost/MathService_cs.vsdisco";
String^ myEncoding = "";
DiscoveryClientProtocol^ myDiscoveryClientProtocol =
   gcnew DiscoveryClientProtocol;

Stream^ myStream = myDiscoveryClientProtocol->Download(
   myDiscoFile, myEncoding );
Console::WriteLine( "The length of the stream in bytes: {0}",
   myStream->Length );
Console::WriteLine( "The MIME encoding of the downloaded " +
   "discovery document: {0}", myEncoding );
myStream->Close();
string myDiscoFile = "http://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();
Dim myDiscoFile As String = "http://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()

적용 대상