Loading ...

Detecting networking devices by asp.net program in I.P ranger

Who is online?  0 guests and 0 members
home  »  forums   »  asp.net topics   »  architecture   » Detecting networking devices by asp.net program in I.P ranger

Detecting networking devices by asp.net program in I.P ranger

Posts under the topic: Detecting networking devices by asp.net program in I.P ranger

Posted: 8/27/2010

Lurker 312  points  Lurker
  • Joined on: 8/27/2010
  • Posts: 54

I have a project in which i want to detect networking devices in a user-defined I.P Range. (Networkking devices like: Printers (along with the status), switches, servers, routers etc) - > all the networking devices along with their respective I.P Address location.

I know i have to use SNMP layer and SNMP libraries in order to accoplish this, but i don't how to go about it ?

Is there anyone who can guide me in a right direction? How it is possible to do all these things from asp.net web based application ?

 

 

 


tags SNMP

Posted: 8/27/2010

Professional 8505  points  Professional
  • Joined on: 5/3/2010
  • Posts: 391

Hello Mike.

First of all, Thank you for joining CodeASP.NET Community.

As per your question, firstly I will recommend you to take a look at the following two links:

http://www.csharphelp.com/2006/11/an-snmp-library-for-net-framework-version-0-2/ (there are few examples)

and here http://www.codeproject.com/KB/cs/SNMPDLL.aspx

You can also use the .NET System.Net - and the System.Net.Dns static class for working with network.

Example: System.Net.IPAddress[] address = System.Net.Dns.GetHostAddresses("hajan"); - gets the IP of my computer in the network. Same you can get the IP of any network device.

However, as you've mentioned, you will need to use SNMP for further achivements.

I will get back to you later or in the following days, let me first test the SNMP. I haven't been working with this since the early release of .NET 2.0 (as I remember).

Regards,
Hajan


Posted: 8/27/2010

Lurker 312  points  Lurker
  • Joined on: 8/27/2010
  • Posts: 54

your welcome hajan...

i will wait for your reply and in the meanwhile i will try to underatand one of the tutorial link you provided above (as i have already tested "codeproject" example and it's not working, just displaying a dos screen and throwing errors)

 

Regards

Mike

 

 


Posted: 8/30/2010

Professional 8505  points  Professional
  • Joined on: 5/3/2010
  • Posts: 391

asp__developer said:

your welcome hajan...

i will wait for your reply and in the meanwhile i will try to underatand one of the tutorial link you provided above (as i have already tested "codeproject" example and it's not working, just displaying a dos screen and throwing errors)

 

Regards

Mike

 

@Mike, I will try to get back to you regarding this today. However, the tutorial might not work properly, but there are shown some methods on how to work with it so that (I suppose) with some modifications, you may come to a result.

Anyway, once I test the scenario you like, I will inform you shortly ;).


Posted: 8/30/2010

Lurker 312  points  Lurker
  • Joined on: 8/27/2010
  • Posts: 54

Thanks hajan, waiting for your reply..

Other than that can you answer my few questions as you mentioned above that you have uses SNMP with asp.net:

1) how many libraries are there in SNMP ?

2) This is the first time i am working with SNMP, does it require network programming ? 

3) In order to deal with SNMP, a DNS layer has to be created ? or how it is going to work ?


Posted: 9/2/2010

Lurker 312  points  Lurker
  • Joined on: 8/27/2010
  • Posts: 54

??


Posted: 9/2/2010

Professional 8505  points  Professional
  • Joined on: 5/3/2010
  • Posts: 391

 

asp__developer said:

user="Mike Williams"]

??

 

Haven't tested yet anything. I'm working parallely on several projects :). I will reply back here as soon as I do some tests.

 


Posted: 9/5/2010

Lurker 312  points  Lurker
  • Joined on: 8/27/2010
  • Posts: 54

alright hajan, i will wait for your reply...

 

Thanks


Posted: 9/8/2010

Lurker 312  points  Lurker
  • Joined on: 8/27/2010
  • Posts: 54

hey hajan, how are you ? any update regarding my SNMP Questions ?


Posted: 9/15/2010

Lurker 312  points  Lurker
  • Joined on: 8/27/2010
  • Posts: 54

asp__developer said:

user="Mike Williams"]

Thanks hajan, waiting for your reply..

Other than that can you answer my few questions as you mentioned above that you have uses SNMP with asp.net:

1) how many libraries are there in SNMP ?

2) This is the first time i am working with SNMP, does it require network programming ? 

3) In order to deal with SNMP, a DNS layer has to be created ? or how it is going to work ?

Any update hajan ?


Posted: 9/15/2010

Professional 8505  points  Professional
  • Joined on: 5/3/2010
  • Posts: 391

Hello @Mike,

I did small research about several ways of dealing with this situation.

Definitely, you will need network programming in order to accomplish your need.

Here is sample code that I've modified a bit (try it):

            ManagementObjectSearcher objSearcher = new ManagementObjectSearcher("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = 'TRUE'");
            ManagementObjectCollection objCollection = objSearcher.Get();

            // Loop through all available network interfaces
            foreach (ManagementObject obj in objCollection)
            {

                // List all IP addresses of the current network interface
                string[] AddressList = (string[])obj["IPAddress"];                

                foreach (string Address in AddressList)
                {
                    Response.Write(Address);
                }
            }


and you will need to ADD REFERENCE to System.Management as a DLL from your .NET assemblies and add it as a directive using System.Management.

Here are some useful links I've found in my research:

http://www.devarticles.com/c/a/C-Sharp/Network-Programming-in-C-sharp/

http://codeidol.com/csharp/csharp-network/IP-Multicasting/What-Is-Broadcasting/

http://www.geekpedia.com/tutorial149_Get-the-IP-address-in-a-Windows-application.html

http://www.codeguru.com/csharp/csharp/cs_network/internetweb/article.php/c6023

http://www.java2s.com/Tutorial/CSharp/0520__Windows/Getthenetworkdevicenamedeviceservicename.htm

 

Hope this helps,
Hajan


Posted: 9/17/2010

Lurker 312  points  Lurker
  • Joined on: 8/27/2010
  • Posts: 54

Thanks hajan for your reply and examples..

Infact i was also doing some research on this...and i guess in order to accoplish this i have to create DNS and SNMP layer.

These layers are not available anywhere as it totally depends on the developer's requirement what he want from the application. So, i guess these 2 layers must be hand-crafted in order to develop architecture of this project...


Posted: 9/17/2010

Professional 8505  points  Professional
  • Joined on: 5/3/2010
  • Posts: 391
  Answered

asp__developer said:

user="Mike Williams"]

Thanks hajan for your reply and examples..

Infact i was also doing some research on this...and i guess in order to accoplish this i have to create DNS and SNMP layer.

These layers are not available anywhere as it totally depends on the developer's requirement what he want from the application. So, i guess these 2 layers must be hand-crafted in order to develop architecture of this project...

Well, probably you are right. Since I don't see any open source or even compiled dll that can simply do that task, you definitely need to create the complete architecture by yourself.

However, when working with networks, you will definitely need to have very very detailed requirements and description of what you want to achieve. Even creating a model of the system would be very great in order to have in mind all the things that might occur while performing any operations. .NET provides native class library that might help you in building your custom application layer that will handle that operations. Refer to the System.Net classes as well as the example I've shown in my previous post.

I hope you will find the best solution for your requirement.

Regards,
Hajan


Page 1 of 1 (13 items)