C# 打开浏览器

来源:互联网 发布:电商cps导购网站源码 编辑:程序博客网 时间:2024/05/16 06:02
System.Runtime.InteropServices[DllImport("shell32.dll", EntryPoint = "ShellExecute", CharSet = CharSet.Auto)]public static extern int ShellExecute_Test(IntPtr hwnd, string lpOperation, string lpFile, string lpParameters, string lpDirectory, int nShowCmd);/// <summary>/// 打开浏览器/// </summary>public void OpenBrowser(){    ShellExecute_Test(Form.ActiveForm.Handle, "Open", "www.baidu.com", "", "", 1);}


原创粉丝点击