2013-02-09 61 views

回答

0

您只能在WebView控件中加载网页。把它放在你的页面上第一:

<WebView x:Name="MyWebView" /> 

在你Hyperlink加载页面的点击事件处理程序到这个WebView

private void Hyperlink_OnClick(object sender, RoutedEventArgs e) 
{ 
    MyWebView.Navigate(new Uri("http://www.facebook.com")); 
} 
0

Process.Start(“http://facebook.com”);这将加载默认浏览器在facebook.com这是你所需要的?

发射器类怎么样?您可以使用Launcher类在默认处理程序中启动文档,即使用默认浏览器加载网站,从我所了解的您无法创建流程的角度来看。

async void DefaultLaunch() 
{ 
    // Path to the file in the app package to launch 
    string imageFile = @"images\test.png"; 

    var file = wait Windows.ApplicationModel.Package.Current.InstalledLocation.GetFileAsync(imageFile); 

    if (file != null) 
    { 
     // Launch the retrieved file 
     var success = await Windows.System.Launcher.LaunchFileAsync(file); 

     if (success) 
     { 
     // File launched 
     } 
     else 
     { 
     // File launch failed 
     } 
    } 
    else 
    { 
     // Could not find file 
    } 
} 
+0

我想放置社交网站的所有图标,当用户点击fb图标,它应该加载http://facebook.com,我在c#和xaml – user2056575 2013-02-09 07:00:50

+0

你想要它加载用户默认浏览器或创建某种Web视图? – Guernica 2013-02-09 07:03:18

+0

它应该加载在我的应用程序页面中,而不是在用户网页或默认浏览器中 – user2056575 2013-02-09 07:23:41

相关问题