Way to set IP address

  • Thread starter Thread starter Manoj Nair
  • Start date Start date
M

Manoj Nair

Hi,
Is there a way by which the IP address of a terminal can be set through
code.

thanks in advance
Manoj
 
Manoj,

I would take a look at the WMI namespaces, which are accessible through
the System.Management namespace, specifically the
Win32_NetworkAdapterConfiguration class (this is a WMI class, not a .NET
class).

Assuming that the network adapter has a static IP already, and you are
assigning an IP from the same subnet and whatnot, it should work no problem.
However, if it is using DHCP, then you will have to make sure to set things
like the DNS servers, the subnet mask, etc, etc.

Hope this helps.
 
Thanks Nicholas
we are currently using WMI for the same purpose.(Sorry missed out mentioning
this before)
The same method EnableStatic of Win32_NetworkAdapterConfiguration seems to
have sme problems with
SP1 on Windows XP
So need some other solution other than WMI
Thanks

Nicholas Paldino said:
Manoj,

I would take a look at the WMI namespaces, which are accessible through
the System.Management namespace, specifically the
Win32_NetworkAdapterConfiguration class (this is a WMI class, not a .NET
class).

Assuming that the network adapter has a static IP already, and you are
assigning an IP from the same subnet and whatnot, it should work no problem.
However, if it is using DHCP, then you will have to make sure to set things
like the DNS servers, the subnet mask, etc, etc.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Manoj Nair said:
Hi,
Is there a way by which the IP address of a terminal can be set through
code.

thanks in advance
Manoj
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top