WPF 打开网页

2021-02-10 18:17

阅读:510

1、利用浏览器打开
using System.Diagnostics;

 Process proc = new System.Diagnostics.Process();

                            proc.StartInfo.FileName = "http://www.baidu.com";

                            proc.Start();

2、在应用程序中打开

                           WebBrowser wb = new WebBrowser();
                            wb.Source = new Uri("http://www.baidu.com");
                            UserControl u = new UserControl();
                            u.Content = wb;
                            将u 显示出来


评论


亲,登录后才可以留言!