共用方式為


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屬性值無效。

適用於