ListBox中有30个网页地址。那么怎么控制程序根据这些地址每次打开一个IE窗口,并且打开后IE变为当前窗口(就是任务栏上IE变为点下状态),那么还有一个问题就是IE打开后怎么根据网页窗口的Caption来关闭IE?

解决方案 »

  1.   

    1.
    ProcessStartInfo startInfo = new ProcessStartInfo("IExplore.exe");
    startInfo.WindowStyle = ProcessWindowStyle.Normal;
    startInfo.Arguments = "www.northwindtraders.com";
    Process.Start(startInfo);2.
    Process [] remoteByName = Process.GetProcesses();
    for (int i = 0; i < remoteByName.Length; i++)
    {
    if (remoteByName[i].MainWindowTitle == "Microsoft Corporation - Microsoft Internet Explorer")
    {
    remoteByName[i].Kill();
    }
    }