if(bDHCP){
string strParameter;strParameter ="netsh interface ip set address name=\"本地连接\" source=dhcp";WinExec(strParameter.c_str(), SW_HIDE);strParameter.clear();strParameter ="netsh interface ip set dns name=\"本地连接\" source=dhcp";WinExec(strParameter.c_str(), SW_HIDE);}else{
string strParameter;strParameter="netsh interface ip set address name=\"本地连接\" static ";strParameter +=T2A(pIPAddress);strParameter +=" ";strParameter +=T2A(pNetMask);strParameter +=" ";strParameter +=T2A(pNetGate);strParameter +=" ";strParameter +="1";if(WinExec(strParameter.c_str(), SW_HIDE)>32)printf("Execute Command Successfully\r\n");elseprintf("Fail To Execute Command\r\n");strParameter="netsh interface ip set dns name=\"本地连接\" source=static addr=";strParameter +=T2A(pDNS);strParameter +=" register = primary";WinExec(strParameter.c_str(), SW_HIDE);strParameter ="netsh interface ip add dns name=\"本地连接\" addr=114.114.115.115";}//2020/1/14 通过c++执行cmd命令来修改win10的ip、子网掩码、网关、DNS//烂笔头