[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.sdk

Network Adapter configuration

alvaro

11/11/2003 2:44:00 PM

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

2 Answers

v-raygon

11/12/2003 7:53:00 AM

0

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=/lib...
/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.

v-raygon

11/12/2003 7:57:00 AM

0

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.