C# 通过Process.Start() 打开程序 置顶方法
private void webBrowser1_Navigating(object sender, WebBrowserNavigatingEventArgs e)
{
try
{
foreach (var item in lis_url)
{
if (e.Url.ToString().StartsWith(item))
{
var p = Process.Start("iexplore.exe", e.Url.ToString());
if (p.Start())
SetForegroundWindow(p.MainWindowHandle);
e.Cancel = true;
break;
}
}
} catch (Exception ex) {
}
}
[DllImport("USER32.DLL")]
public static extern bool SetForegroundWindow(IntPtr hWnd);
鹰击长空,鱼翔浅底