diff options
-rw-r--r-- | toggleproxy/toggleproxy.c | 24 | ||||
-rw-r--r-- | toggleproxy/toggleproxy.exe | bin | 0 -> 53760 bytes |
2 files changed, 24 insertions, 0 deletions
diff --git a/toggleproxy/toggleproxy.c b/toggleproxy/toggleproxy.c new file mode 100644 index 0000000..cf44226 --- /dev/null +++ b/toggleproxy/toggleproxy.c @@ -0,0 +1,24 @@ +#include <stdio.h> +#include <windows.h> +#include <wininet.h> + +#pragma comment(lib, "Wininet.lib") + +int main(int argc, char *argv[]) { + int r; + + if (argc != 2) { + fprintf(stderr, "usage: %s {1|0}\n", argv[0]); + return 1; + } + + if (argv[1][0] == '0') + r = system("reg add \"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\" /v ProxyEnable /t REG_DWORD /d 0 /f"); + else + r = system("reg add \"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\" /v ProxyEnable /t REG_DWORD /d 1 /f"); + if (r == 0) { + InternetSetOption(NULL, INTERNET_OPTION_SETTINGS_CHANGED, NULL, 0); + InternetSetOption(NULL, INTERNET_OPTION_REFRESH, NULL, 0); + } + return r; +}
\ No newline at end of file diff --git a/toggleproxy/toggleproxy.exe b/toggleproxy/toggleproxy.exe Binary files differnew file mode 100644 index 0000000..2f0e2d4 --- /dev/null +++ b/toggleproxy/toggleproxy.exe |