473,797 Members | 3,196 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 3912
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
17794
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
4748
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
2364
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
3996
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
6128
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
10728
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
2812
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
2011
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
16098
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
9537
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10209
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
10023
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9066
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...
0
6803
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
5459
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5582
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4135
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
3750
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.