C# 如何使用XAML(windows-8应用程序)在默认浏览器中打开URL
如何使用XAML(windows-8应用程序)在默认浏览器中打开URL 使用时:C# 如何使用XAML(windows-8应用程序)在默认浏览器中打开URL,c#,.net,url,windows-8,C#,.net,Url,Windows 8,如何使用XAML(windows-8应用程序)在默认浏览器中打开URL 使用时: Process.Start("http://www.google.com/"); 错误命名空间“System.Diagnostics”中不存在类型或命名空间名称“Process”(是否缺少程序集引用?您可以使用该方法 错误名称“Launcher”在当前上下文中不存在:\n我已用完整命名空间更新了答案。您需要使用Windows.System添加在代码顶部或键入名称空间。我想当用户单击按钮时,应用程序打开网站为什么
Process.Start("http://www.google.com/");
错误命名空间“System.Diagnostics”中不存在类型或命名空间名称“Process”(是否缺少程序集引用?您可以使用该方法
错误名称“Launcher”在当前上下文中不存在:\n我已用完整命名空间更新了答案。您需要使用Windows.System添加
代码>在代码顶部或键入名称空间。我想当用户单击按钮时,应用程序打开网站为什么可以这样做?您是否尝试了更新的代码?(使用完全限定的命名空间Windows.System.Launcher.launchurisync(uri);
)以及所有命名空间错误elseDupe
private async void LaunchSite(string siteAddress)
{
try
{
Uri uri = new Uri(siteAddress);
var launched = await Windows.System.Launcher.LaunchUriAsync(uri);
}
catch (Exception ex)
{
//handle the exception
}
}