Redigera

Dela via


UploadStringCompletedEventArgs.Result Property

Definition

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

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

Property Value

A Byte array that contains the server reply.

Examples

The following code example displays the value of this property.

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

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