如何将我的网址 www.facebook.com 链接到我的超链接按钮。它应该加载到我的应用页面中。
问问题
497 次
2 回答
0
Process.Start("http://facebook.com"); that will load the default browser at facebook.com is this what you require ?
how about the launcher class ? You can use the Launcher class to launch a document in the default handler, i.e load a website with the default browser, from what i understand you cant just create a process.
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
}
}
于 2013-02-09T06:52:39.937 回答
0
WebView
您只能在控件内加载网页。首先将其放在页面上的某个位置:
<WebView x:Name="MyWebView" />
在您Hyperlink
将页面加载到此的 click 事件处理程序中WebView
:
private void Hyperlink_OnClick(object sender, RoutedEventArgs e)
{
MyWebView.Navigate(new Uri("http://www.facebook.com"));
}
于 2013-02-09T07:52:58.813 回答