How can I programmatically configure an ETHERNET ADAPTER
to use DHCP in a WORKSTATION that can be running Windows
98/ME/NT/2K/XP?
Can I do it with a managed code using C# ? If not, how can
I do it with VC++ / Platform SDK?
Thanks in advance,
Alvaro Pereira
Rhett Gong - 12 Nov 2003 07:52 GMT
Hi Alvaro:
There are two ways can be used to achieve your goal.
1. the Win32_NetworkAdapterConfiguration.EnableDHCP in WMI class can be
used to configure the Adapter to use DHCP. If you know WMI, you can go here
for more
information:http://msdn.microsoft.com/library/default.asp?url=/library/en-us
/wmisdk/wmi/win32_networkadapterconfiguration.asp
2. you can modify the registry programmatically to achieve the goal:
System Key: [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\{Adapter}\
Parameters\Tcpip]
Value Name: EnableDHCP
Data Type: REG_BINARY (Binary Value)
1--Enable
0--Disable
Best regards,
Rhett Gong [MSFT]
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties and confers no rights.
Rhett Gong - 12 Nov 2003 07:56 GMT
Hi Alvaro:
I think no direct class in C# can be used to configure the adapter to
use DHCP.
Best regards,
Rhett Gong [MSFT]
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties and confers no rights.