Click here to Skip to main content
11,925,730 members (56,305 online)
Click here to Skip to main content
Add your own
alternative version


41 bookmarked

Simple Network Scanner

, 24 Apr 2008 CPOL
Rate this:
Please Sign up or sign in to vote.
Scans given workgroup for computer names, with IP and MAC addresses


This simple network scanner scans the given work group/domain for computers in Directory Services. It also displays their IP and MAC addresses. You will also find code to get IP address against computer name and to get MAC address against IP address.


It all started when I was developing a Backup System, which was supposed to list all the computers in a network and later, the user can select any one or all computers and can record backup.

Using the Code

This is a very easy to use application. Just download this application and type your work group or domain name and press Scan button.

In the first step, this system will get all directory entries in Directory Services (to use directory services in your project, you must add a reference to System.DirectoryServices namespace) using the following code:

DirectoryEntry DomainEntry = new 
    DirectoryEntry("WinNT://" + txtWorkGroupName.Text + ""); 

Next it will iterate for all computers/machines through DomainEntry; and it will call getIPByName() function to get the IP address. getIPByName() function uses System.Net.DNS static class to get the IP address.

Finally, there is a function getMACAddress(IPAddress ipAddress). In this SendARP() function call has been made to get the MAC address against IP. SendARP() is part of iphlpapi.dll.

Points of Interest

You can get a list of computers in your network with their IP and MAC addresses, which means it is a three in one package.


  • 24th April, 2008: Initial post


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Software Developer (Senior) Business Intelligence Technologies 360
Pakistan Pakistan
I have a Masters Degree in Information Technology, supported by a Bachelors Degree in Information Technology. I am working as a software developer for five years. I have a good experience in developing business applications including Accounting, Payroll, Inventory and Student Information systems. I have also developed an application name Virtual Reception. Which is a Artificial Intelligence based, interactive application.

You may also be interested in...

Comments and Discussions

QuestionChange Function Pin
mohd fazreen27-Sep-15 17:04
membermohd fazreen27-Sep-15 17:04 
QuestionHello Pin
Member 967019313-Apr-13 6:06
memberMember 967019313-Apr-13 6:06 
GeneralMy vote of 4 Pin
Burak Tunçbilek27-Jul-12 10:39
memberBurak Tunçbilek27-Jul-12 10:39 
Generaldownload link is broken Pin
Houston Yap19-Jun-12 7:49
memberHouston Yap19-Jun-12 7:49 
QuestionHello Pin
mustyname27-Apr-12 2:44
membermustyname27-Apr-12 2:44 
thanks a lot for this program its really useful. is it possible add hardware information to in this program ı need this till 2 of may wednesday. please write under here
GeneralAbout The Network Pin
aimanmfk3-Jul-08 21:11
memberaimanmfk3-Jul-08 21:11 
GeneralQuestion Pin
Hans Dietrich24-Apr-08 1:53
mvpHans Dietrich24-Apr-08 1:53 
GeneralRe: Question Pin
mamirbalouch24-Apr-08 23:51
membermamirbalouch24-Apr-08 23:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.151126.1 | Last Updated 24 Apr 2008
Article Copyright 2008 by mamirbalouch
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid