How to Get Local Area IP Address?
-
How can i get all IP addresses which connected in LAN using ASP.NET // Private Function GetIP4Address() As String Dim IP4Address As String = [String].Empty For Each IPA As IPAddress In Dns.GetHostAddresses(Dns.GetHostName()) If IPA.AddressFamily.ToString() = "InterNetwork" Then IP4Address = IPA.ToString() Exit For End If Next Return IP4Address End Function // I'm using this function but it returns only my IP address. Please help me... Thanks in advance...
-
How can i get all IP addresses which connected in LAN using ASP.NET // Private Function GetIP4Address() As String Dim IP4Address As String = [String].Empty For Each IPA As IPAddress In Dns.GetHostAddresses(Dns.GetHostName()) If IPA.AddressFamily.ToString() = "InterNetwork" Then IP4Address = IPA.ToString() Exit For End If Next Return IP4Address End Function // I'm using this function but it returns only my IP address. Please help me... Thanks in advance...
So you want to list all machines i LAN?
No more Mister Nice Guy... >: |
-
How can i get all IP addresses which connected in LAN using ASP.NET // Private Function GetIP4Address() As String Dim IP4Address As String = [String].Empty For Each IPA As IPAddress In Dns.GetHostAddresses(Dns.GetHostName()) If IPA.AddressFamily.ToString() = "InterNetwork" Then IP4Address = IPA.ToString() Exit For End If Next Return IP4Address End Function // I'm using this function but it returns only my IP address. Please help me... Thanks in advance...
The first thing you ought to learn is: differenciate between code executed on the server and code executed on the client (user site). You say you are using ASP.NET - just think: where is that code executed? And another thing you ought to learn: there are many security mechanisms when it comes to code (JavaScript etc.) running in a web browser! Why should anyone want to allow you to find out which other IP addresses are used in his local (private) network? Because he wants to make a virus/worm attack easy for some hacker?
-
How can i get all IP addresses which connected in LAN using ASP.NET // Private Function GetIP4Address() As String Dim IP4Address As String = [String].Empty For Each IPA As IPAddress In Dns.GetHostAddresses(Dns.GetHostName()) If IPA.AddressFamily.ToString() = "InterNetwork" Then IP4Address = IPA.ToString() Exit For End If Next Return IP4Address End Function // I'm using this function but it returns only my IP address. Please help me... Thanks in advance...
Dim ipaddress As String = HttpContext.Current.Request.UserHostAddress by using this we can get client ip address and Dim ipaddress As String = HttpContext.Current.Request.UserHostName by using this we can get client host name
-
The first thing you ought to learn is: differenciate between code executed on the server and code executed on the client (user site). You say you are using ASP.NET - just think: where is that code executed? And another thing you ought to learn: there are many security mechanisms when it comes to code (JavaScript etc.) running in a web browser! Why should anyone want to allow you to find out which other IP addresses are used in his local (private) network? Because he wants to make a virus/worm attack easy for some hacker?
Thank you sir , but i want to know only that IP address which are connected Client site LAN only.Is it possible?
-
Dim ipaddress As String = HttpContext.Current.Request.UserHostAddress by using this we can get client ip address and Dim ipaddress As String = HttpContext.Current.Request.UserHostName by using this we can get client host name
Thanks ......Its working.
N.K.Basak