📄 netcfg.c
字号:
order++;
if (PrevDisable) {
//ActiveAreaSuspend(PrevId,AREA_REENABLE);
//Disp16String("上一步",3,221);
//PrevDisable=FALSE;
quit=1;
break;
}
}else{
quit = 1;
order--;
if (NextDisable) {
NextDisable=FALSE;
//Disp16String("下一步",56,221);
break;
}
}
if (order>=entry_num){
order=entry_num;
NextDisable=TRUE;
Disp16String("完 成",56,221);
quit = 3;
}
else if (order<0) {
order=0;
PrevDisable=TRUE;
//0Disp16StringGrey(DARK_GREY,"上一步",3,221);
//ActiveAreaSuspend(PrevId,AREA_SUSPEND);
}
//ClearRec(WHITE,2,48,155,94,REPLACE_STYLE);
//Disp16String(Title[order],5,48);
switch(order-1)
{
case 0: point=Cfg.dns; break;
case 1: point=Cfg.smtp; break;
case 2: point=Cfg.popser; break;
case 3: point=Cfg.popacc; break;
case 4: point=Cfg.poppass; break;
case 5: point=Cfg.dialnum; break;
case 6: point=Cfg.dialacc; break;
case 7: point=Cfg.dialpass; break;
}
/*#ifdef GSMSMS
switch(order)
{
case 0: point=Cfg.smtp; break;
case 1: point=Cfg.popser; break;
case 2: point=Cfg.popacc; break;
case 3: point=Cfg.poppass; break;
case 4: point=Cfg.smscenter; break;
case 5: point=Cfg.smsgateway; break;
}
#endif*/
//if (EditOpenMode.open_line==EDIT_OPENED) closelineedit();
/*we disable pen interrupt for the safe sake*/
//PenIrptDisable();
//openlineedit(80, point,CfgTemp[order].len, CfgTemp[order].dft_input, CfgTemp[order].allow_input, 0);
/* we re-enable the pen interrupt after the open procedual*/
//PenIrptEnable();
//mark=0;
}
else if (Msg.lparam==HelpId){
//ActiveAreaRead(areaId,&xSrc,&ySrc,&xDest,&yDest);
//InvRec((xSrc+1),(ySrc+1),(xDest-(xSrc+1)),(yDest-(ySrc+1)));
//helpinfo(helptext[order]);
break;
}
else if (Msg.lparam == bt_cancel){
//ActiveAreaRead(areaId,&xSrc,&ySrc,&xDest,&yDest);
//InvRec((xSrc+1),(ySrc+1),(xDest-(xSrc+1)),(yDest-(ySrc+1)));
if (verbose)
//i=SelButtonWin("将放弃系统配置","确定吗?",str1,3,0);
cur = GetCurWindow( );
i= (U8)MessageBox(cur, "将放弃系统配置,确定吗?", "友情提醒", MB_YESNOCANCEL );
if (i==IDYES){
quit=2;
break;
}else if (i==IDNO){
quit =1;
break;
}else if (i==IDCANCEL){
quit=1;
break;
verbose=FALSE;
}
}
break;
case WM_QUIT:
quit = 2;
break;
default:
break;
}
DefWindowProc(Msg.message, Msg.lparam, Msg.data, Msg.wparam);
}
if(quit!=2) GetEditorStr( edit, point, CfgTemp[order-1].len );
DestroyWindow( edit );
//ActiveAreaDisable(XAreaId);
//ActiveAreaDisable(PrevId);
//ActiveAreaDisable(NextId);
//ActiveAreaDisable(QuitId);
//ActiveAreaDisable(HelpId);
//if (EditOpenMode.open_line==EDIT_OPENED) closelineedit();
if (quit==2) {DestroyWindow( cfgwin );return;}
if (quit==1) goto recfg;
/*The following is the code from Lingming*/
//lm:
Netcfg->Dns.pridns = Cfg.dns;
Netcfg->Dns.secdns = Cfg.dns;
//Netcfg->Dns.pridns = aton(Cfg.dns);
//Netcfg->Dns.secdns = aton(Cfg.dns);
/* check the DNS.11/28/1999*/
if ( Netcfg->Dns.pridns==0 ){
//AdvHintWin("DNS服务器地址错!","请核实.",60,0);
cur = GetCurWindow( );
MessageBox(cur, "DNS服务器地址错!,请核实.", "友情提醒", 0 );
point=Cfg.dns;
order=0;
goto recfg;
}
/*we copy the smtp and pop3 infor*/
strcpy(Netcfg->Mail[0].smtpserver, Cfg.smtp);
strcpy(Netcfg->Mail[0].popserver , Cfg.popser);
strcpy(Netcfg->Mail[0].popaccount, Cfg.popacc);
strcpy(Netcfg->Mail[0].poppassword, Cfg.poppass);
Netcfg->Mail[0].popdelete = 0;
Netcfg->Mail[0].poptimeout = 1; /*10/22/1999*/
Netcfg->Mail[0].smtptimeout= 1;
/*we copy the dial infor */
strcpy(Netcfg->Dial[0].dialnumber , Cfg.dialnum);
strcpy(Netcfg->Dial[0].dialaccount , Cfg.dialacc);
strcpy(Netcfg->Dial[0].dialpassword, Cfg.dialpass);
Netcfg->Dial[0].flag = DEFAULT;
/* Check the dial number11/28/1999*/
if ( *(Netcfg->Dial[0].dialnumber)=='\0' )
{
//AdvHintWin("拨号号码为空","请核实.",60,0);
cur = GetCurWindow( );
MessageBox(cur, "拨号号码为空!,请核实.", "友情提醒", 1 );
order=5;
point=Cfg.dialnum;
goto recfg;
}
/* check the dial account11/28/1999*/
if ( *(Netcfg->Dial[0].dialaccount)=='\0')
{
//AdvHintWin("拨号帐号为空","请核实.",60,0);
cur = GetCurWindow( );
MessageBox(cur, "拨号帐号为空!,请核实.", "友情提醒", 1 );
order=6;
point=Cfg.dialacc;
goto recfg;
}
/*#ifdef GSMSMS
strcpy(Netcfg->Gateway[0].SMScenter , Cfg.smscenter);
strcpy(Netcfg->Gateway[0].SMSgateway , Cfg.smsgateway);
if (strlen(Netcfg->Gateway[0].SMScenter)<11 ){
AdvHintWin("号码少于11个数字","请核实.",60,0);
point=Cfg.smscenter;
order=4;
goto recfg;
}
if ( strlen(Netcfg->Gateway[0].SMSgateway)<11 )
{
AdvHintWin("号码少于11个数字","请核实.",60,0);
order=5;
point=Cfg.smsgateway;
goto recfg;
}
Netcfg->Gateway[0].SMScenter[11]=Netcfg->Gateway[0].SMSgateway[11]=0x46;
#endif*/
*(unsigned int *)(Netcfg->Valid)=CFGVALID;
Netcfg->Flag = MODIFIED;
Mailed=TRUE;
memcpy(Datatemp+NETCFG_HEAD,Netcfg,sizeof(struct netcfg));
DestroyWindow( cfgwin );
return;
}
U32 aton(s)
register char *s;
{
U32 n;
register U16 i;
n = 0;
if(s == NULL)
return 0;
for(i=24;i>=0;i -= 8){
/* Skip any leading stuff (e.g., spaces, '[') */
//while(*s != '\0' && !isdigit(*s))
while(*s != '\0')
s++;
if(*s == '\0')
break;
n |= (U32)atoi(s) << i;
if((s = strchr(s,'.')) == NULL)
break;
s++;
}
return n;
}
char *
inet_ntoa1(a)
U32 a;
{
static char buf[16];
sprintf(buf,"%u.%u.%u.%u",
hibyte(hiword(a)),
lobyte(hiword(a)),
hibyte(loword(a)),
lobyte(loword(a)) );
return buf;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -