![]() |
|
|||||||
| Net / Sockets Components for network and related use |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hi,
I'm currently working on an application that first pings and then, if something "pings back", checks the ip-address using the GetHostEntry statement. If a device is connected at ex. IP 192.168.1.50, it pops up on a list. But I was wondering... Is it possible to get the name of that device? GetHostEntry only gives me the IP-address (unless its a computer, then the computer name pops up) if it find a router, modem, a mobile device etc... For example: I have a dreambox connected on my network. Is there a way to get the name of the dreambox when i know its ip??? Or my Nokia? Or my wireless printer??? I'm uploading a picture of the application so you might better understand what i mean. PS: The text in the application is in Norwegian...
__________________
best regards _ powerade_ |
|
||||
|
There could possibly be other ways and information when DNS host name is not available, but these could also mean more device specific interfacing. One global option is to get the MAC address, the first 3 bytes of these 6 is something called OUI (Organizationally Unique Identifier) and there exist a public list where you can at least find out which manufacturer produced the NIC, the other 3 bytes probably only each manufacturer known what means. Here is an example I have tested and which worked, you need this declaration:
Quote:
Sample code to get MAC and OUI: Code:
Dim ip As Integer = CInt(Net.IPAddress.Parse("192.123.45.67").Address)
Dim mem As Long
Dim ret As Integer = SendARP(ip, 0, mem, 6)
Dim ab() As Byte = BitConverter.GetBytes(mem)
Dim OUI As String = BitConverter.ToString(ab, 0, 3)
With the OUI string you can search the text file or create yourself a smaller lookup table from it. When successful it is for example more useful to know this manufacturer name "CANON INC." than only the IP.
__________________
See this thread about how to use forum markup codes for code blocks etc (present the problem/post properly )Some useful links: Learning videoes, WMI Code Creator, MSDN, The Code Project, WindowsClient.net, ASP.net, W3 Schools, Regular-Expressions.info, GDI+ FAQ DR. WEIR: Download it to a non-networked, firewalled computer. TECHNICIAN: Yes, ma'am. |
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|