Tutorials
Forum
Resources
Reviews
Jobs
Interview
Videos
Communities
Projects
Training
Silverlight Games
|
Bookmarks
|
Mentor
|
Code Converter
|
IT Companies
|
Peer Appraisal
|
Members
|
Polls
|
Revenue Sharing
|
Computer Jokes
|
New Posts
|
Lobby
|
Gift Shop
|
Online Members
Gokula
Raghu
Sankar
Anil Kumar Pandey
chaminda
Lawrence
lingamurthy
Sridhar
Sunitha
cloud
Rajalingam
More...
Resources
»
Code Snippets
»
Network
How to get all IP address on a LAN network
Posted Date:
04-May-2008
Category:
Network
Rating:
Author:
Rekha
Member Level:
Gold
Points
: 15 (
Rs
15)
The following code sample shows how to get all IP address on a LAN network
Must have a reference to System.Net.DLL in your reference list.
Imports System.Net
Public Shared Function GetAllIP(Optional ByVal args As String() = Nothing) As Integer
'args in the signature is optional, without it
'the function will simply get the hostname
'of the local machine then go from there
Dim strHostName As New String("")
If args.Length = 0 Then
' Getting Ip address of local machine...
' First get the host name of local machine.
strHostName = DNS.GetHostName()
Console.WriteLine("Local Machine's Host Name: " + strHostName)
Else
strHostName = args(0)
End If
' Then using host name, get the IP address list..
Dim ipEntry As IPHostEntry = DNS.GetHostByName(strHostName)
Dim addr As IPAddress() = ipEntry.AddressList
Dim i As Integer = 0
While i < addr.Length
Console.WriteLine("IP Address {0}: {1} ", i, addr(i).ToString())
System.Math.Max(System.Threading.Interlocked.Increment(i), i - 1)
End While
Return 0
End Function
Did you like this resource? Share it with your friends and show your love!
Tweet
Share
Responses to "How to get all IP address on a LAN network"
No responses found. Be the first to respond...
Feedbacks
Post Comment:
Notify me by email when others post comments to this article.
Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
No HTML formatting and links to other web sites are allowed.
This is a strictly moderated site. Absolutely no spam allowed.
Name:
Sign In
to fill automatically.
Email:
(Will not be published, but
required
to validate comment)
Type the numbers and letters shown on the left.
Next Resource:
How to get ping in milliseconds
Previous Resource:
Function to find the network traffic
Return to Resources
Post New Resource
Category:
Network
Post resources and
earn money
!
More Resources
How to get ping in milliseconds
Internet ConnectionStatus and NetworkConnection Type
TurnOff the Monitor using C#
Verify user credentials using API
Retrive the Free Space of a Network drive using C#
Find host name or an IP of a given host
Popular Tags
Tag posting guidelines
Search Tags
(No tags found.)
My Profile
Sign In
Register
AdSense Revenue
Active Members
Today
Asheej T K
(85)
Ajatshatru Upa...
(48)
Pawan Awasthi
(31)
Last 7 Days
Asheej T K
(327)
Paritosh Mohap...
(289)
Ajatshatru Upa...
(253)
more...
Awards & Gifts
Email subscription
.NET Jobs
.NET Articles
.NET Forums
Articles Rss Feeds
Forum Rss Feeds
About Us
Trademark Disclaimer
Contact Us
Copyright
Privacy Policy
Terms Of Use
Revenue Sharing sites
Advertise
Talk to
Tony John
Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India
2005 - 2012 All Rights Reserved.
.NET and other trademarks mentioned in this site belong to Microsoft and other respective trademark owners.
Articles, tutorials and all other content offered here is for educational purpose only.
We are not associated with Microsoft or its partners.