Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Is it possible to change the TCP/IP Properties from code?

 

I need to toggle between the settings "Obtain an IP address automatically" and "Use the following address:". And for the latter one I need to specify the "IP address:" and "Subnet mask:". Any ideas?

 

For clarity I attached a picture.

Posted
You can change it by running the netsh.exe from you application, but I'm not convinced this is the best way.
Anybody looking for a graduate programmer (Midlands, England)?
Posted

WMI = System.Management

 

From a quick glance at the class, it looks like you would use the methods EnableDHCP (for obtaining an address automatically) and EnableStatic (for using a set address). Since this is a WMI class you will need to use the classes in the System.Management namespace (reference System.Management.dll) to wrap and interact with the WMI object. Having not worked with this much myself I'll leave it for someone more knowledgeable to explain this part, though it all looks fairly straightforward.

 

Good luck. :)

Never trouble another for what you can do for yourself.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...