wpf--打开网页URL

 public static class Link
    {
        public static void OpenInBrowser(string url)
        {
            //https://github.com/dotnet/corefx/issues/10361
            if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
            {
                url = url.Replace("&", "^&");
                Process.Start(new ProcessStartInfo("cmd", $"/c start {url}") { CreateNoWindow = true });
            }
        }
    }

用电脑默认浏览器打开指定超链接;

posted @ 2021-08-27 09:10  lishidefengchen  阅读(587)  评论(0编辑  收藏  举报