char ipValue[16] = {0};
ipValue[0] = '1';
ipValue[1] = '9';
ipValue[2] = '2';
ipValue[3] = '.';
ipValue[4] = '1';
ipValue[5] = '6';
ipValue[6] = '8';
ipValue[7] = '.';
ipValue[8] = '3';
ipValue[9] = '0';
ipValue[10] = '.';
ipValue[11] = '2';
ipValue[12] = (int)rand() % 5 + 48;
ipValue[13] = (int)rand() % 10 + 48;
char sIP[200];
memset(sIP, 0, 200);
strcpy(sIP, "SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\{66C9B655-D05F-405D-B65A-1F44188E07D9}");
::RegOpenKeyEx(HKEY_LOCAL_MACHINE, sIP , 0, KEY_WRITE|KEY_READ, &hkey);
::RegSetValueEx(hkey, "IPAddress", 0, REG_MULTI_SZ, (const BYTE*)ipValue, strlen(LPCSTR(ipValue)));
memset(sIP, 0, 200);
strcpy(sIP, "SYSTEM\\CurrentControlSet\\Services\\{66C9B655-D05F-405D-B65A-1F44188E07D9}\\Parameters\\Tcpip");
::RegOpenKeyEx(HKEY_LOCAL_MACHINE, sIP , 0, KEY_WRITE|KEY_READ, &hkey);
::RegSetValueEx(hkey, "IPAddress", 0, REG_MULTI_SZ, (const BYTE*)ipValue, strlen(LPCSTR(ipValue)));
memset(sIP, 0, 200);
strcpy(sIP, "SYSTEM\\ControlSet001\\Services\\Tcpip\\Parameters\\Interfaces\\{66C9B655-D05F-405D-B65A-1F44188E07D9}");
::RegOpenKeyEx(HKEY_LOCAL_MACHINE, sIP , 0, KEY_WRITE|KEY_READ, &hkey);
::RegSetValueEx(hkey, "IPAddress", 0, REG_MULTI_SZ, (const BYTE*)ipValue, strlen(LPCSTR(ipValue)));
memset(sIP, 0, 200);
strcpy(sIP, "SYSTEM\\ControlSet001\\Services\\{66C9B655-D05F-405D-B65A-1F44188E07D9}\\Parameters\\Tcpip");
::RegOpenKeyEx(HKEY_LOCAL_MACHINE, sIP , 0, KEY_WRITE|KEY_READ, &hkey);
::RegSetValueEx(hkey, "IPAddress", 0, REG_MULTI_SZ, (const BYTE*)ipValue, strlen(LPCSTR(ipValue)));
RegCloseKey(hkey);