在界面上添加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; }此程序的一个缺点时当运行它时不能再浏览其他网页
转载于:https://www.cnblogs.com/webman/archive/2006/11/18/564873.html
相关资源:C#网页自动刷新器(开源)