DownloadStringCompletedEventArgs.Result 속성
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
메서드에서 다운로드한 DownloadStringAsync 데이터를 가져옵니다.
public:
property System::String ^ Result { System::String ^ get(); };
public string Result { get; }
member this.Result : string
Public ReadOnly Property Result As String
속성 값
다운로드한 데이터가 포함된 A String 입니다.
예제
다음 코드 예제에서는이 속성의 값을 표시 합니다.
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
설명
이 속성에서 반환되는 Error 데이터를 사용하기 전에 해당 속성과 Cancelled 속성을 확인해야 합니다. 속성 값이 ErrorException 개체이거나 Cancelled 속성 값이 true면 비동기 작업이 제대로 Result 완료되지 않았으며 속성 값이 유효하지 않습니다.