Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何使用XAML(windows-8应用程序)在默认浏览器中打开URL_C#_.net_Url_Windows 8 - Fatal编程技术网

C# 如何使用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添加在代码顶部或键入名称空间。我想当用户单击按钮时,应用程序打开网站为什么

如何使用XAML(windows-8应用程序)在默认浏览器中打开URL

使用时:

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
    }
}