在界面上添加Label1   textBox1   Button1    Button2    timer1 
并设置timer1.Enable=false  interval可以先设置10000,运行时凭感觉再适当缩小


private void timer1_Tick(object sender, System.EventArgs e)
  {
   KillProcess("IEXPLORE");
   Process.Start("IExplore.exe", textBox1.Text);
   
  }
  private void KillProcess(string processName)
  {
   try
   {
    foreach (Process thisproc in Process.GetProcessesByName(processName))
    {
     if(!thisproc.CloseMainWindow())
     {
      thisproc.Kill();
     }
    }
   }
   catch(Exception Exc)
   {

   }
  }

  private void button1_Click(object sender, System.EventArgs e)
  {
   timer1.Enabled=true;
  }

  private void button2_Click(object sender, System.EventArgs e)
  {
   timer1.Enabled=false;
  }
此程序的一个缺点时当运行它时不能再浏览其他网页

相关文章:

  • 2022-02-08
  • 2021-09-12
  • 2021-08-18
  • 2022-12-23
  • 2022-12-23
  • 2021-11-17
  • 2021-12-05
  • 2021-12-16
猜你喜欢
  • 2021-10-25
  • 2021-07-30
  • 2021-06-25
  • 2021-10-05
  • 2022-12-23
  • 2021-10-06
相关资源
相似解决方案