1   private void webBrowser1_Navigating(object sender, WebBrowserNavigatingEventArgs e)
 2         {
 3             try
 4             {
 5                 foreach (var item in lis_url)
 6                 {
 7                     if (e.Url.ToString().StartsWith(item))
 8                     {
 9                         var p = Process.Start("iexplore.exe", e.Url.ToString());
10                         if (p.Start())
11                             SetForegroundWindow(p.MainWindowHandle);
12                         e.Cancel = true;
13                         break;
14                     }
15                 }
16             }
17             catch (Exception ex)
18             {
19             }
20         }
21         [DllImport("USER32.DLL")]
22         public static extern bool SetForegroundWindow(IntPtr hWnd);

 

相关文章:

  • 2022-12-23
  • 2022-02-03
  • 2022-12-23
  • 2022-12-23
  • 2021-12-09
  • 2021-06-14
  • 2022-12-23
  • 2022-01-28
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-01
  • 2022-12-23
相关资源
相似解决方案