473,703 Members | 2,738 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Getting and Setting the network settings.

UJ
I had already asked how to get the network settings on the machine and was
told that I should use the WMI interface. I downloaded programs that will
allow me to look at the stuff but I'm not sure which items are the correct
ones to get.

Can anybody give me a direction on where I look to figure out how to get/set
the IP address, gateway, DNS Server and Proxy Server? When I look in one of
the dump programs there is lots of stuff about network adapters but I can't
figure out which is the one I want.

TIA - Jeff.
Jan 18 '06 #1
5 3909
Jeff,

You can use the Win32_NetworkAd apterConfigurat ion class. The properties
you want are:

IPAddress
DNSServerSearch Order
DefaultIPGatewa y

The proxy is a different story, that you would get from the program
itself that is using the proxy. This program might or might not have a WMI
interface. Or do you mean another type of proxy that is system wide?

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"UJ" <fr**@nowhere.c om> wrote in message
news:%2******** ********@TK2MSF TNGP15.phx.gbl. ..
I had already asked how to get the network settings on the machine and was
told that I should use the WMI interface. I downloaded programs that will
allow me to look at the stuff but I'm not sure which items are the correct
ones to get.

Can anybody give me a direction on where I look to figure out how to
get/set the IP address, gateway, DNS Server and Proxy Server? When I look
in one of the dump programs there is lots of stuff about network adapters
but I can't figure out which is the one I want.

TIA - Jeff.

Jan 18 '06 #2
UJ
Nicholas,
I guess I'm not sure what I mean. My network engineer wants to be able to
change the proxy server through our interface.

Is that enough information or do I need his input?

TIA - Jeff.

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote in
message news:uy******** ******@TK2MSFTN GP10.phx.gbl...
Jeff,

You can use the Win32_NetworkAd apterConfigurat ion class. The
properties you want are:

IPAddress
DNSServerSearch Order
DefaultIPGatewa y

The proxy is a different story, that you would get from the program
itself that is using the proxy. This program might or might not have a
WMI interface. Or do you mean another type of proxy that is system wide?

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"UJ" <fr**@nowhere.c om> wrote in message
news:%2******** ********@TK2MSF TNGP15.phx.gbl. ..
I had already asked how to get the network settings on the machine and was
told that I should use the WMI interface. I downloaded programs that will
allow me to look at the stuff but I'm not sure which items are the correct
ones to get.

Can anybody give me a direction on where I look to figure out how to
get/set the IP address, gateway, DNS Server and Proxy Server? When I look
in one of the dump programs there is lots of stuff about network adapters
but I can't figure out which is the one I want.

TIA - Jeff.


Jan 18 '06 #3
UJ
Nicholas,
All the documentation I've seen talks about using either VBScript or CScript
to use this object. Can it be used in a C# program?

If not - how do I get/set the info?

TIA - Jeff.

"UJ" <fr**@nowhere.c om> wrote in message
news:e4******** ******@TK2MSFTN GP11.phx.gbl...
Nicholas,
I guess I'm not sure what I mean. My network engineer wants to be able to
change the proxy server through our interface.

Is that enough information or do I need his input?

TIA - Jeff.

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote
in message news:uy******** ******@TK2MSFTN GP10.phx.gbl...
Jeff,

You can use the Win32_NetworkAd apterConfigurat ion class. The
properties you want are:

IPAddress
DNSServerSearch Order
DefaultIPGatewa y

The proxy is a different story, that you would get from the program
itself that is using the proxy. This program might or might not have a
WMI interface. Or do you mean another type of proxy that is system wide?

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"UJ" <fr**@nowhere.c om> wrote in message
news:%2******** ********@TK2MSF TNGP15.phx.gbl. ..
I had already asked how to get the network settings on the machine and
was told that I should use the WMI interface. I downloaded programs that
will allow me to look at the stuff but I'm not sure which items are the
correct ones to get.

Can anybody give me a direction on where I look to figure out how to
get/set the IP address, gateway, DNS Server and Proxy Server? When I
look in one of the dump programs there is lots of stuff about network
adapters but I can't figure out which is the one I want.

TIA - Jeff.



Jan 18 '06 #4
A proxy server can mean anything. Is it a proxy for external
connections? Is it ISA server? Some more information is needed.

For example, you can set the proxy server for http requests in Internet
Explorer, but this is just IE, it's not for the whole system.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"UJ" <fr**@nowhere.c om> wrote in message
news:e4******** ******@TK2MSFTN GP11.phx.gbl...
Nicholas,
I guess I'm not sure what I mean. My network engineer wants to be able to
change the proxy server through our interface.

Is that enough information or do I need his input?

TIA - Jeff.

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote
in message news:uy******** ******@TK2MSFTN GP10.phx.gbl...
Jeff,

You can use the Win32_NetworkAd apterConfigurat ion class. The
properties you want are:

IPAddress
DNSServerSearch Order
DefaultIPGatewa y

The proxy is a different story, that you would get from the program
itself that is using the proxy. This program might or might not have a
WMI interface. Or do you mean another type of proxy that is system wide?

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"UJ" <fr**@nowhere.c om> wrote in message
news:%2******** ********@TK2MSF TNGP15.phx.gbl. ..
I had already asked how to get the network settings on the machine and
was told that I should use the WMI interface. I downloaded programs that
will allow me to look at the stuff but I'm not sure which items are the
correct ones to get.

Can anybody give me a direction on where I look to figure out how to
get/set the IP address, gateway, DNS Server and Proxy Server? When I
look in one of the dump programs there is lots of stuff about network
adapters but I can't figure out which is the one I want.

TIA - Jeff.



Jan 18 '06 #5
Jeff,

Yes, you will want to use the classes in the System.Manageme nt namespace
in order to access the WMI classes.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"UJ" <fr**@nowhere.c om> wrote in message
news:uw******** ******@TK2MSFTN GP15.phx.gbl...
Nicholas,
All the documentation I've seen talks about using either VBScript or
CScript to use this object. Can it be used in a C# program?

If not - how do I get/set the info?

TIA - Jeff.

"UJ" <fr**@nowhere.c om> wrote in message
news:e4******** ******@TK2MSFTN GP11.phx.gbl...
Nicholas,
I guess I'm not sure what I mean. My network engineer wants to be able to
change the proxy server through our interface.

Is that enough information or do I need his input?

TIA - Jeff.

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote
in message news:uy******** ******@TK2MSFTN GP10.phx.gbl...
Jeff,

You can use the Win32_NetworkAd apterConfigurat ion class. The
properties you want are:

IPAddress
DNSServerSearch Order
DefaultIPGatewa y

The proxy is a different story, that you would get from the program
itself that is using the proxy. This program might or might not have a
WMI interface. Or do you mean another type of proxy that is system
wide?

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"UJ" <fr**@nowhere.c om> wrote in message
news:%2******** ********@TK2MSF TNGP15.phx.gbl. ..
I had already asked how to get the network settings on the machine and
was told that I should use the WMI interface. I downloaded programs that
will allow me to look at the stuff but I'm not sure which items are the
correct ones to get.

Can anybody give me a direction on where I look to figure out how to
get/set the IP address, gateway, DNS Server and Proxy Server? When I
look in one of the dump programs there is lots of stuff about network
adapters but I can't figure out which is the one I want.

TIA - Jeff.



Jan 18 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

303
17657
by: mike420 | last post by:
In the context of LATEX, some Pythonista asked what the big successes of Lisp were. I think there were at least three *big* successes. a. orbitz.com web site uses Lisp for algorithms, etc. b. Yahoo store was originally written in Lisp. c. Emacs The issues with these will probably come up, so I might as well mention them myself (which will also make this a more balanced
4
4740
by: Umesh | last post by:
Hi all I am trying to change the printer(like paper source ,etc) setting in C#. But i am unable to do it. I am not sure how to do it. should i have to use WIN API like Openprinter , getprinter , setprinter . I did try with PrinterSetting.setHDevMode but it does not work. Its their is a simple way to change printersetting. thanks umesh.
3
2358
by: CSN | last post by:
Is is possible to find out what options (prefix, bindir, etc.) were specified to "configure" when Postgres was built? __________________________________ Do you Yahoo!? New Yahoo! Photos - easier uploading and sharing. http://photos.yahoo.com/ ---------------------------(end of broadcast)---------------------------
5
3989
by: Doug Handler | last post by:
Does anyone know how to access the Settings property information? VS2k5 created this, all documentation basically only points to VB.NET. When you try it in C#, nothing is accessible. Any thoughts - has anyone been successful in accessing this information via code? If so, can you show me an example? dh
1
6122
by: sathyp | last post by:
Public Function SetPrinterDefaultsW(ByVal sPrinterName As String, _ ByVal nPaperSize As Long, ByVal nOrientation As Long) As Boolean Dim Prn As Printer Dim hPrinter As Long Dim pd As PRINTER_DEFAULTS Dim pinfo2 As PRINTER_INFO_2 Dim pinfo8 As PRINTER_INFO_8 Dim pinfo9 As PRINTER_INFO_9 Dim dm As DEVMODEW Dim yDevModeData() As Byte
4
10723
by: Odd Bjørn Andersen | last post by:
I have installed DB2 9 Enterprise Edition on my laptop (Windows xp prof. ed.). But when I try to connect to any of my local databases I get this error: SQL30082N Security processing failed with reason "19" ("USERID DISABLED or RESTRICTED"). SQLSTATE=08001 I am quite certain that this user is valid, I have used it to log on to the pc. The properties of the user also looks fine -password never expires, and the disabled checkbox is NOT...
6
2806
by: WT | last post by:
Hello, Using VS2005. I have an assembly library that can be called from a Web site asp.net application or from a winform application. From this library I need to retrieve a path using simply a key like 'libPath'. As far as winform and asp.net share the same common base class for settings, SettingsBase, how to manage this ? For winform the value should be set in app.config and for web site in
0
2005
by: aboutjav.com | last post by:
Hi, I need some help. I am getting this error after I complete the asp.net register control and click on the continue button. It crashed when it tries to get it calls this Profile property ((string)(this.GetPropertyValue("Address1")));
8
16093
by: Andrus | last post by:
..NET 2 Winforms application. How to create new setting and set it default value in userSettings section of app.config file or overwrite existing setting value ? I found code below in this list which modifies Application setting section but how to add new item to userSettings ? Andrus.
0
9236
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8988
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7835
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6580
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5913
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4672
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3108
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2411
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2044
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.