using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
//Application.Run(new Class1());
int t = 0;
while (true)
{
t=t+1;
if (t >3)
{
System.Environment.Exit(System.Environment.ExitCode); //使用强制结束的话
}
System.Threading.Thread.Sleep(500);
System.Diagnostics.Process.Start("iexplore.exe", "http://www.baidu.com"); //调用IE
}
}
}
}
C# 调用浏览器打开网页链接
最新推荐文章于 2025-10-21 09:43:10 发布
本示例展示了一个简单的C#程序,该程序通过循环不断地启动Internet Explorer浏览器并打开百度网站。程序还包括了基本的视觉样式设置,并在循环条件满足时强制退出。
972

被折叠的 条评论
为什么被折叠?



