Result Property
Collapse the table of content
Expand the table of content

OpenReadCompletedEventArgs::Result Property


Gets a readable stream that contains data downloaded by a DownloadDataAsync method.

Namespace:   System.Net
Assembly:  System (in System.dll)

property Stream^ Result {
	Stream^ get();

Property Value

Type: System.IO::Stream^

A Stream that contains the downloaded data.

You should check the Error and Cancelled properties before using the data that is returned by this property. If the Error property's value is an Exception object or the Cancelled property's value is true, the asynchronous operation did not complete correctly and the Result property's value will not be valid.

Legacy Code Example

The following code example uses the stream returned by this property.

void OpenReadCallback2( Object^ /*sender*/, OpenReadCompletedEventArgs^ e )
   Stream^ reply = nullptr;
   StreamReader^ s = nullptr;
      reply = dynamic_cast<Stream^>(e->Result);
      s = gcnew StreamReader( reply );
      Console::WriteLine( s->ReadToEnd() );
      if ( s != nullptr )
      if ( reply != nullptr )


.NET Framework
Available since 2.0
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Return to top
© 2015 Microsoft