如何在C#.NET中设置特定Internet Explorer 8实例的代理设置?
我想设置特定Internet Explorer 8实例的代理设置。这是我的密码:如何在C#.NET中设置特定Internet Explorer 8实例的代理设置?,c#,.net,internet-explorer-8,watin,wininet,C#,.net,Internet Explorer 8,Watin,Wininet,我想设置特定Internet Explorer 8实例的代理设置。这是我的密码: static Process RunNewIE8Instance(string proxySettings) { ProcessStartInfo IEStartInfo = new ProcessStartInfo(); IEStartInfo.FileName = "IExplore.exe"; IEStartInfo.Arguments = " -nomerge -private ";
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.
*/
}
其目的是使沙盒Internet Explorer 8实例具有自己的代理设置和cookie JAR(cookie JAR部分已经使用
-private-nomerge
参数完成)。可能应该通过引用传递局部变量。(参考)这就是你需要的?我无法使用您提供的解决方案更改IEprocess的设置provided@microfed-答案中描述的GlobalProxySelection不推荐使用。