3

I would like to set proxy settings of a specific Internet Explorer 8 instance. Here is my code:

static Process RunNewIE8Instance(string proxySettings)
{
    ProcessStartInfo IEStartInfo = new ProcessStartInfo();
    IEStartInfo.FileName = "IExplore.exe";
    IEStartInfo.Arguments = " -nomerge -private ";

    Process IEProcess = Process.Start(IEStartInfo);

    // Here is the problem:
    SetProxySettingsOfAProcess(IEProcess, proxySettings);

    return IEProcess;
}

static void SetProxySettingsOfAProcess(Process IEProcess, string proxySettings)
{
    /* I don't know how to do this,
     * I tried everything, the most "successful" solution was with the registry..
     * But I don't want machine-wide settings, I want to set settings only for the wininet instance of IEProcess
     * The browser is used for testing, and I need to be able to spawn multiple Internet Explorer 8 instances with multiple proxy settings, one proxy for each instance.
    */
}

The purpose is to have sandboxed Internet Explorer 8 instances with their own proxy settings and cookie JAR (the cookie JAR part is already done with the -private -nomerge parameters).

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131

0 Answers0