DiscoveryClientProtocol.Download Método
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Descarrega o documento de descoberta na URL fornecida para um Stream objeto.
Sobrecargas
| Name | Description |
|---|---|
| Download(String) |
Descarrega o documento de descoberta na URL fornecida para um Stream objeto. |
| Download(String, String) |
Descarrega o documento de descoberta na URL fornecida para um Stream objeto, definindo o |
Download(String)
Descarrega o documento de descoberta na URL fornecida para um Stream objeto.
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
Parâmetros
- url
- String
O URL do documento de descoberta para descarregar.
Devoluções
A contendo Stream o documento na URL fornecida.
Exceções
O download da URL fornecida devolveu um código de estado HTTP diferente de OK.
Exemplos
// 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()
Aplica-se a
Download(String, String)
Descarrega o documento de descoberta na URL fornecida para um Stream objeto, definindo o contentType parâmetro para a codificação MIME do documento de descoberta.
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
Parâmetros
- url
- String
O URL do documento de descoberta para descarregar.
- contentType
- String
A codificação MIME do documento de descoberta descarregado.
Devoluções
A contendo Stream o documento na URL fornecida.
Exceções
O download da URL fornecida devolveu um código de estado HTTP diferente de OK.
Exemplos
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()