【问题标题】:Open Web Browser from XAML app从 XAML 应用程序打开 Web 浏览器
【发布时间】:2012-12-29 18:51:14
【问题描述】:

我想从我的 XAML 应用打开外部网络浏览器,类似于:want to open Link in external browser of WP7

我似乎找不到 WebBrowserTask 对象:

Dim wbt As New WebBrowserTask()
wbt.Uri = New Uri("http://xxx.xxx.com/xxx.aspx")
wbt.Show()

WindowsRT/XAML 还有其他方法吗?

谢谢!

【问题讨论】:

    标签: c# vb.net xaml windows-runtime


    【解决方案1】:
    await Launcher.LaunchUriAsync(new Uri(uri));
    

    【讨论】:

    • 我可能误解了你的问题,但是 XAML 中的这个 (Win phone 8 XAML 代码-在新窗口中打开 IE 中的 Url)
    【解决方案2】:

    你应该使用Launcher class

    Dim uri As New Uri("http://www.bing.com")
    
    Async Sub DefaultLaunch()
    
       ' Launch the URI
       Dim success = await Windows.System.Launcher.LaunchUriAsync(uri)
    
       If success Then
          ' URI launched
       Else
          ' URI launch failed
       End If
    
    End Sub
    

    【讨论】:

      猜你喜欢
      • 2011-03-20
      • 2019-01-01
      • 2015-04-22
      • 2014-05-29
      • 2014-03-09
      • 2012-05-07
      • 2017-11-06
      • 1970-01-01
      • 2018-03-13
      相关资源
      最近更新 更多