UploadStringCompletedEventArgs.Result 属性

定义

获取通过调用 UploadStringAsync 方法启动的字符串上载操作的服务器回复。

public:
 property System::String ^ Result { System::String ^ get(); };
public string Result { get; }
member this.Result : string
Public ReadOnly Property Result As String

属性值

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

示例

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

void UploadStringCallback2( Object^ /*sender*/, UploadStringCompletedEventArgs^ e )
{
   String^ reply = dynamic_cast<String^>(e->Result);
   Console::WriteLine( reply );
}
private static void UploadStringCallback2(Object sender, UploadStringCompletedEventArgs e)
{
    string reply = (string)e.Result;
    Console.WriteLine(reply);
}
Private Shared Sub UploadStringCallback2(ByVal sender As Object, ByVal e As UploadStringCompletedEventArgs)
    Dim reply As String = CStr(e.Result)
    Console.WriteLine(reply)
End Sub

注解

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

适用于