Guidance:
You can change the IP address location.
On NT, first obtain the name of the network device driver:
Snetcardregkey: = '/software/Microsoft/Windows NT/CurrentVersion/networkcards/1'; 1 or other sub-keys that can be enumerated in this place
Regrootkey. rootkey: = HKEY_LOCAL_MACHINE;
Regrootkey. openkeyreadonly (snetcardregkey );
Snetcarddrivername: = regrootkey. readstring ('servicename ');
Then:
Sserviceregkey: = '/system/CurrentControlSet/services /';
Stcpipregkey: = sserviceregkey + snetcarddrivername + '/parameters/tcpip ';
Obtain all IP addresses of the device in 'ipaddress '.
Regrootkey. readbinarydata ('ipaddress', cipaddressarray, 255 );
Obtain the subnet mask corresponding to the IP address in 'subnetmask '.
Regrootkey. readbinarydata ('subnetmask', cnetmaskarray, 255 );
IN Win95/98:
How to obtain the device name:
Snetcardregkey: = '/Enum/Network/mstcp/0001/'; 0001 or other sub-keys that can be enumerated here
Sserviceregkey: = '/system/CurrentControlSet/services/class /';
Regrootkey. rootkey: = HKEY_LOCAL_MACHINE;
Regrootkey. openkeyreadonly (snetcardregkey );
Snetcarddrivername: = regrootkey. readstring ('driver ');
Then:
Stcpipregkey: = sserviceregkey + snetcarddrivername;
Regrootkey. openkeyreadonly (stcpipregkey );
Finally, obtain the IP address and subnet mask:
Sipaddress: = regrootkey. readstring ('ipaddress ');
Snetmask: = regrootkey. readstring ('ipmask ');
Win95 does not support multiple addresses of a device.
This article is transferred from
Http://topic.csdn.net/t/20021124/14/1201306.html