473,804 Members | 1,999 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Listing Network adaptors question.

Hi,

I've got two network adaptors in my computer(Window s server 2003).
One for public network such as internet, and the other for a private
network.
I mean, I want to connect other 2 PCs (XP Pro with SP3) to this adaptor and
create a private LAN.

Now I want to run my server application with the host IP of the
second(private
network) adaptor on the server PC( Windows server 2003).

I'm using Visual Studio.NET 2003 and C# for server applicaiton development.
Now, how can we list/scan all the available network adaptors and
corresponding
IP address using C#.

Kindly let me know.
Cheers,

Naveen.

Nov 16 '05 #1
5 1879
Try this:

System.Manageme nt.SelectQuery sq = new
System.Manageme nt.SelectQuery( "Win32_NetworkA dapterConfigura tion",
"IPEnabled='TRU E'");

System.Manageme nt.ManagementOb jectSearcher searcher = new
System.Manageme nt.ManagementOb jectSearcher(sq );

foreach (System.Managem ent.ManagementO bject mos in searcher.Get())

{

MessageBox.Show (mos.GetPropert yValue("Caption ").ToString ());//Shows the
name

string[] obj = (string[])mos.GetPropert yValue("IPAddre ss");

foreach(string s in obj)

{

MessageBox.Show (s);

}

}

Look for Win32_NetworkAd apterConfigurat ion in SDK for a complete information
about your network adapters.
Hope that helps.
Nov 16 '05 #2
Is your server application running in IIS? If so, simply configure the site
to run on the IP address of the private network. No coding required.

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"Naveen Mukkelli" <Na************ @discussions.mi crosoft.com> wrote in
message news:06******** *************** ***********@mic rosoft.com...
Hi,

I've got two network adaptors in my computer(Window s server 2003).
One for public network such as internet, and the other for a private
network.
I mean, I want to connect other 2 PCs (XP Pro with SP3) to this adaptor
and
create a private LAN.

Now I want to run my server application with the host IP of the
second(private
network) adaptor on the server PC( Windows server 2003).

I'm using Visual Studio.NET 2003 and C# for server applicaiton
development.
Now, how can we list/scan all the available network adaptors and
corresponding
IP address using C#.

Kindly let me know.
Cheers,

Naveen.

Nov 16 '05 #3
Hi Nick,

Honestly speaking, I have no knowledge about IIS and
obviously, I don't know whether my application is
running in IIS or not.

Could you please let me know the starting point to know
more about IIS and also could you please let me know
how to configure IIS.

Cheers,

Naveen.

"Nick Malik [Microsoft]" wrote:
Is your server application running in IIS? If so, simply configure the site
to run on the IP address of the private network. No coding required.

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"Naveen Mukkelli" <Na************ @discussions.mi crosoft.com> wrote in
message news:06******** *************** ***********@mic rosoft.com...
Hi,

I've got two network adaptors in my computer(Window s server 2003).
One for public network such as internet, and the other for a private
network.
I mean, I want to connect other 2 PCs (XP Pro with SP3) to this adaptor
and
create a private LAN.

Now I want to run my server application with the host IP of the
second(private
network) adaptor on the server PC( Windows server 2003).

I'm using Visual Studio.NET 2003 and C# for server applicaiton
development.
Now, how can we list/scan all the available network adaptors and
corresponding
IP address using C#.

Kindly let me know.
Cheers,

Naveen.


Nov 16 '05 #4
Hi Adrian,

Thanx for your response.
It works...

Cheers,

Naveen.

"Adrian" wrote:
Try this:

System.Manageme nt.SelectQuery sq = new
System.Manageme nt.SelectQuery( "Win32_NetworkA dapterConfigura tion",
"IPEnabled='TRU E'");

System.Manageme nt.ManagementOb jectSearcher searcher = new
System.Manageme nt.ManagementOb jectSearcher(sq );

foreach (System.Managem ent.ManagementO bject mos in searcher.Get())

{

MessageBox.Show (mos.GetPropert yValue("Caption ").ToString ());//Shows the
name

string[] obj = (string[])mos.GetPropert yValue("IPAddre ss");

foreach(string s in obj)

{

MessageBox.Show (s);

}

}

Look for Win32_NetworkAd apterConfigurat ion in SDK for a complete information
about your network adapters.
Hope that helps.

Nov 16 '05 #5
Hello Naveen,

I'm a bit surprised. You have a server based application that you are
connecting to IP addresses, so you must be a reasonably technical developer.
Yet you don't appear to have any familiarity with Internet Information
Server, the web/application server built in to every Windows Server OS.
Perhaps you simply weren't familiar with the acronym? (I apologize if my
use of the acronym was unclear in my previous post).

I am not aware of what your application is doing, or how you are planning to
accomplish your goal, so it is difficult to know if using IIS is feasable.
In addition, the fact that you are technical and have made headway running
your app without IIS leads me to believe that it may not be an effective use
of your time to refactor your app to use IIS or Web Services.

That said, if your app was constructed as an IIS HTTPHandler or an
HTTPModule, or even an ISAPI filter, then you could leverage IIS for
handling the port mapping.

HTH,

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"Naveen Mukkelli" <Na************ @discussions.mi crosoft.com> wrote in
message news:F0******** *************** ***********@mic rosoft.com...
Hi Nick,

Honestly speaking, I have no knowledge about IIS and
obviously, I don't know whether my application is
running in IIS or not.

Could you please let me know the starting point to know
more about IIS and also could you please let me know
how to configure IIS.

Cheers,

Naveen.

"Nick Malik [Microsoft]" wrote:
Is your server application running in IIS? If so, simply configure the
site
to run on the IP address of the private network. No coding required.

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"Naveen Mukkelli" <Na************ @discussions.mi crosoft.com> wrote in
message news:06******** *************** ***********@mic rosoft.com...
> Hi,
>
> I've got two network adaptors in my computer(Window s server 2003).
> One for public network such as internet, and the other for a private
> network.
> I mean, I want to connect other 2 PCs (XP Pro with SP3) to this
> adaptor
> and
> create a private LAN.
>
> Now I want to run my server application with the host IP of the
> second(private
> network) adaptor on the server PC( Windows server 2003).
>
> I'm using Visual Studio.NET 2003 and C# for server applicaiton
> development.
> Now, how can we list/scan all the available network adaptors and
> corresponding
> IP address using C#.
>
> Kindly let me know.
>
>
> Cheers,
>
> Naveen.
>


Nov 16 '05 #6

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

Similar topics

4
1331
by: Mark A. Gibbs | last post by:
good day, i'm not sure if i'm using the standard function adaptors correctly. i want to use a member function in a call to transform(), but not a member function of the class being transformed. i have: class B {}; class C {};
2
1775
by: Drew McCormack | last post by:
I have a self written Tensor class which I need to write a number of elementwise operations for (eg sin, cos, abs, conj). I am trying to implement most of these in terms of standard library functions. Unfortunately, not all functions in the standard library are constructed the same (eg some are template functions, some use pass-by-value where others use pass by reference). To get around this, I have tried to come up with an adaptor...
8
1664
by: SpOiLeR | last post by:
Hi there... I have something like this: #include <string> #include <list> #include <algorithm> using namespace std; typdef list<string> ls;
2
2166
by: N. Graves | last post by:
I'm having trouble with an ODBC User that can't connect to 2003 Windows Server with SQL2000. The ODBC fails when he tries to contact with TCP client connection. When I view the Network Connection it is displaying TCP is checked, but when I view the error log is doesn't display that it is listening for TCP. Is there any way to prove that my TCP connections are working correctly or a way to make sure that my SQL server is listening for
3
4561
by: Bill McNeal | last post by:
Anyone have seem a sample code or some white papers for this? Thanks in advance. -- --------------- Valmir Cinquini
3
4556
by: John Barr | last post by:
Does anyone know how to search for Instances of SQL Server running on your network through code to populate a drop down like is done in the SQL Server Query Analyzer, and then once an instance is selected, list the databases on that Instance?
1
1396
by: medvitz | last post by:
I'm writing an ASP.NET application that requires that a list of files from a network shre be displayed on the site. We are using windows integrated authorizations and impersonation. Whenever I try to access the network share I get the following error. DirectoryNotFoundException saying "Could not find a part of the path "\\server\share" In looking to solve this, I have come across multiple items discussing the double hop...
4
3252
by: techusky | last post by:
I have a *very* simple script written that displays the directory listing of the current working directory, but I am having some difficulty when I try to change folders. Basically, I have my $dir variable set to this: --- $dir = getcwd() . "\\" . $nav; --- but for some reason the script does not actually display the contents of the directory if you change from the directory the script is located in. Here is my code if someone is willing...
2
1002
by: Seth Williams | last post by:
What do I need to take into consideration when, on an ASP.Net website, to get a file listing (I already have the code) from a another network server? Currently I get an 'Access to path denied' message
0
10594
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...
0
10343
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10087
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
9166
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
7631
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
6861
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
5529
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
5667
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3831
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.