开发者

How to set proxy settings of a specific Internet Explorer 8 instance in C# .NET?

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 proxySett开发者_C百科ings)
{
    /* 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).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜