*/ 出自: 编程中国 http://www.bc-cn.net
*/ 作者: zzcko
*/ 时间: 2007-8-21 编程论坛首发
*/ 声明: 尊重作者劳动,转载请保留本段文字
*/ --------------------------------------------------------------------------------------
以下的程序是编译通过的(在WIN-TCH上)
/* Agent server setting *
* --------@author zzc */
#include "Stdio.h"
#include "Stdlib.h"
#include "Caonio.h"
#include "time.h"
void setting()
{
char *p,*q;
char t1[20]="\"",t2[20]="\"";
char str1[20];
char str2[10];
char str3[200]="echo \"ProxyServer\"=\"";
p=str1;
q=str2;
system("cls");
printf("Please input agent server IP address(Default 10.38.84.248):");
gets(str1);
if(strlen(str1)==0)
p="10.38.84.248";
printf("Please input port number(Default 808):");
gets(str2);
if(strlen(str2)==0)
q="808";
strcat(str3,p);
strcat(str3,":");
strcat(str3,q);
strcat(str3,"\" >>set.reg");
system("echo Windows Registry Editor Version 5.00 >set.reg");
system("echo.>>set.reg");
system("echo [HKEY_LOCAL_MACHINE\\SOFTWARE\\Policies\\Microsoft\\Internet Explorer\\Control Panel] >>set.reg");
system("echo \"Proxy\"=dword:00000000 >>set.reg");
system("echo.>>set.reg");
system("echo [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Internet Settings] >>set.reg");
system("echo \"ProxyEnable\"=dword:00000001 >>set.reg");
system(str3);
system("echo.>>set.reg");
system("echo.>>set.reg");
system("reg import set.reg");
system("del set.reg");
printf("Press any key return main menu!");
getch();
}
void unset()
{
system("cls");
system("echo Windows Registry Editor Version 5.00 >unset.reg");
system("echo.>>unset.reg");
system("echo [HKEY_LOCAL_MACHINE\\SOFTWARE\\Policies\\Microsoft\\Internet Explorer\\Control Panel] >>unset.reg");
system("echo \"Proxy\"=dword:00000001 >>unset.reg");
system("echo.>>unset.reg");
system("echo [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Internet Settings] >>unset.reg");
system("echo \"ProxyEnable\"=dword:00000000 >>unset.reg");
system("echo \"ProxyServer\"=\" : \" >>unset.reg");
system("echo.>>unset.reg");
system("echo.>>unset.reg");
system("reg import unset.reg");
system("del unset.reg");
printf("Press any key return main menu!");
getch();
}
void main()
{
int sel;
while(1)
{
system("cls");
printf("Agent server setting\n\t\t ---@Author ZZC\n\n1.Agent server setting\n2.Close agent\n3.Exit\n");
scanf("%d",&sel);
switch(sel)
{
case 1:
setting();
break;
case 2:
unset();
break;
case 3:
exit(0);
default :
system("cls");
printf("Please select 1~3!\n");
printf("Press any key return main menu!");
getch();
}
}
}