DownloadStringCompletedEventArgs.Result 속성

정의

DownloadStringAsync 메서드로 다운로드한 데이터를 가져옵니다.

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

속성 값

다운로드한 데이터가 들어 있는 String입니다.

예제

다음 코드 예제에서는이 속성의 값을 표시합니다.

void DownloadStringCallback2( Object^ /*sender*/, DownloadStringCompletedEventArgs^ e )
{

   // If the request was not canceled and did not throw
   // an exception, display the resource.
   if (  !e->Cancelled && e->Error == nullptr )
   {
      String^ textString = dynamic_cast<String^>(e->Result);
      Console::WriteLine( textString );
   }
}
private static void DownloadStringCallback2(Object sender, DownloadStringCompletedEventArgs e)
{
    // If the request was not canceled and did not throw
    // an exception, display the resource.
    if (!e.Cancelled && e.Error == null)
    {
        string textString = (string)e.Result;

        Console.WriteLine(textString);
    }
}
Private Shared Sub DownloadStringCallback2(ByVal sender As Object, ByVal e As DownloadStringCompletedEventArgs)

    '  If the request was not canceled and did not throw
    '  an exception, display the resource.
    If e.Cancelled = False AndAlso e.Error Is Nothing Then

        Dim textString As String = CStr(e.Result)
        Console.WriteLine(textString)
    End If
End Sub

설명

확인 해야 합니다 ErrorCancelled 이 속성에 의해 반환 되는 데이터를 사용 하기 전에 속성입니다. 경우는 Error 속성의 값이를 Exception 개체 또는 Cancelled 속성의 값이 true, 비동기 작업이 제대로 완료 되지 않은 및 Result 속성의 값을 유효 하지 않게 됩니다.

적용 대상