Private Sub LoadDocument()
' Web からファイルを読み込みます
Dim client As New HttpClient()
Dim url As String = "http://cdn.componentone.com/files/win8/Win8_UXG_RTM.pdf"
Try
Dim stream = Await client.GetStreamAsync(New Uri(url, UriKind.Absolute))
pdfViewer.LoadDocument(stream)
Catch
Dim dialog = New MessageDialog("There was an error attempting to download the document.")
dialog.ShowAsync()
End Try
End Sub
コードのコピー
private async void LoadDocument()
{
// Web からファイルを読み込みます
HttpClient client = new HttpClient();
string url = “http://cdn.componentone.com/files/win8/Win8_UXG_RTM.pdf”;
try
{
var stream = await client.GetStreamAsync(new Uri(url, UriKind.Absolute));
pdfViewer.LoadDocument(stream);
}
catch
{
var dialog = new MessageDialog("There was an error attempting to download the document.");
dialog.ShowAsync();
}
}