Bewerken

Delen via


UploadFileCompletedEventArgs.Result Property

Definition

Gets the server reply to a data upload operation that is started by calling an UploadFileAsync method.

public:
 property cli::array <System::Byte> ^ Result { cli::array <System::Byte> ^ get(); };
public byte[] Result { get; }
member this.Result : byte[]
Public ReadOnly Property Result As Byte()

Property Value

Byte[]

A Byte array that contains the server reply.

Examples

The following code example displays the value of this property.

void UploadFileCallback2( Object^ /*sender*/, UploadFileCompletedEventArgs^ e )
{
   String^ reply = System::Text::Encoding::UTF8->GetString( e->Result );
   Console::WriteLine( reply );
}
private static void UploadFileCallback2(Object sender, UploadFileCompletedEventArgs e)
{
    string reply = System.Text.Encoding.UTF8.GetString(e.Result);
    Console.WriteLine(reply);
}
Private Shared Sub UploadFileCallback2(ByVal sender As Object, ByVal e As System.Net.UploadFileCompletedEventArgs)

    Dim reply As String = System.Text.Encoding.UTF8.GetString(e.Result)
    Console.WriteLine(reply)
End Sub

Remarks

You should check the Error and Cancelled properties to determine whether the upload completed. 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.

Applies to