I try to use c# program to change proxy server address.
[DllImport("wininet.dll")]
public static extern bool InternetSetOption(IntPtr hInternet, int dwOption, IntPtr lpBuffer, int dwBufferLength);
public const int INTERNET_OPTION_SETTINGS_CHANGED = 39;
public const int INTERNET_OPTION_REFRESH = 37;
bool settingsReturn, refreshReturn;
void SetProxy()
{
RegistryKey RegKey = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings", true);
RegKey.SetValue("ProxyServer", "192.168.1.1:8082");
RegKey.SetValue("ProxyEnable", 1);
settingsReturn = InternetSetOption(IntPtr.Zero, INTERNET_OPTION_SETTINGS_CHANGED, IntPtr.Zero, 0);
refreshReturn = InternetSetOption(IntPtr.Zero, INTERNET_OPTION_REFRESH, IntPtr.Zero, 0);
}
First thing is I cant find ProxyServer
key in registry and when I created it and still it doesn't solve the problem.
And when I try to enter manually in my pc and I found that still proxy server is not used by internet explorer. And it shows my own ip in whatismyip.com
I don't understand why it is happening even I tried to reinstall the os.. problem still exists So is there any solution?