Thursday, May 24, 2012

Change Proxy C# example

ye i know there r millions exapmle but i wanna point out 2 thing:       
string todaysProxy = "";
RegistryKey registry = Registry.CurrentUser.OpenSubKey
             ("Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings", true);
registry.SetValue("ProxyEnable", "00000001", RegistryValueKind.DWord);
registry.SetValue("ProxyEnable", 1);
registry.SetValue("ProxyServer", todaysProxy);
registry.SetValue("ProxyOverride", "192.168.0.*;127.0.0.*;localhost");

1 - ProxyEnable - either int 1 or define kind, unlike the batch
2 - O.C. IT WONT TAKE IMMIDIATE AFFECT but only on the new sessions, unless:

No comments:

Post a Comment