Поделиться через


DiscoveryDocumentReference.ReadDocument(Stream) Метод

Определение

Считывает и возвращает документ обнаружения из переданного объекта Stream.

public:
 override System::Object ^ ReadDocument(System::IO::Stream ^ stream);
public override object ReadDocument (System.IO.Stream stream);
override this.ReadDocument : System.IO.Stream -> obj
Public Overrides Function ReadDocument (stream As Stream) As Object

Параметры

stream
Stream

Stream, содержащий документ обнаружения.

Возвращаемое значение

DiscoveryDocument, включающий содержимое упоминаемого документа обнаружения.

Примеры

String^ myUrl = "http://localhost/Sample_cs.vsdisco";
DiscoveryClientProtocol^ myProtocol = gcnew DiscoveryClientProtocol;
DiscoveryDocumentReference^ myReference = gcnew DiscoveryDocumentReference( myUrl );
Stream^ myFileStream = myProtocol->Download( myUrl );
DiscoveryDocument^ myDiscoveryDocument = dynamic_cast<DiscoveryDocument^>(myReference->ReadDocument( myFileStream ));
string myUrl = "http://localhost/Sample_cs.vsdisco";
DiscoveryClientProtocol myProtocol = new DiscoveryClientProtocol();
DiscoveryDocumentReference myReference = new DiscoveryDocumentReference(myUrl);
Stream myFileStream = myProtocol.Download(ref myUrl);
DiscoveryDocument myDiscoveryDocument =
                  (DiscoveryDocument)myReference.ReadDocument(myFileStream);
Dim myUrl As String = "http://localhost/Sample_vb.vsdisco"
Dim myProtocol As New DiscoveryClientProtocol()
Dim myReference As New DiscoveryDocumentReference(myUrl)
Dim myFileStream As Stream = myProtocol.Download(myUrl)
Dim myDiscoveryDocument As DiscoveryDocument = _
        CType(myReference.ReadDocument(myFileStream), DiscoveryDocument)

Применяется к

См. также раздел