UploadFileCompletedEventArgs.Result 属性

定义

获取通过调用 UploadFileAsync 方法启动的数据上载操作的服务器回复。

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()

属性值

Byte[]

一个包含服务器回复的 Byte 数组。

示例

下面的代码示例显示此属性的值。

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

注解

应检查 ErrorCancelled 属性以确定上传是否完成。 Error如果属性的值为 Exception 对象或Cancelled属性的值为 true,则异步操作未正确完成,Result并且该属性的值将无效。

适用于