Hi, I would like to know how to get IP Address of the devices connected to the hotspot of my PC using a VB program that will run on the same PC where the hotspot is running.
I have no idea how to get it strated. I searched internet but I what I am seeing is that there is an external router. Thank you very much.

Dani AI

Generated

Quick summary and a practical plan (builds on and ): there are two reliable approaches — query the Wi‑Fi "hosted network" for peers (gives MACs), then map MAC→IP; or read the OS ARP/neighbor table after a quick ping sweep to discover client IPs. The Native Wi‑Fi Hosted Network API (WlanHostedNetworkQueryStatus) can list peers (MACs). Use the IP Helper / ARP table (GetIpNetTable or arp -a) to map MACs to IPv4 addresses. (learn.microsoft.com)

Minimal VB.NET workflow (fast to implement)

  1. Detect which adapter is the hotspot/ICS adapter (WMI or NetworkInterface) and its IPv4/subnet. 2) Do a quick threaded ping sweep of that subnet to populate the ARP cache. 3) Read/parsethe ARP table (either call arp -a and parse or P/Invoke GetIpNetTable) and filter entries on the hotspot interface. Example (run arp and parse output):

Dim p As New Process()
p.StartInfo.FileName = "arp"
p.StartInfo.Arguments = "-a"
p.StartInfo.UseShellExecute = False
p.StartInfo.RedirectStandardOutput = True
p.Start()
Dim output As String = p.StandardOutput.ReadToEnd()
p.WaitForExit()
' parse lines like: " 192.168.137.2 00-11-22-33-44-55 dynamic"

Notes, pitfalls and where WMI helps

  • If Windows is using ICS/Mobile Hotspot the host often uses 192.168.137.1 and gives clients 192.168.137.x; that makes subnet scanning easy. (learn.microsoft.com)
  • Netsh (or the Hosted Network API) can show connected clients for SoftAP/hostednetwork setups; Mobile Hotspot behavior can differ by Windows version, so check with netsh wlan show hostednetwork first. (learn.microsoft.com)
  • WMI (Win32_NetworkAdapterConfiguration) is useful to find the hotspot adapter and its IP/mask, but it does not provide a DHCP-lease table for ICS clients — you still need ARP/IpHelper or the Native Wi‑Fi peer list to get connected devices. (learn.microsoft.com)

If the goal is a robust tool, use native IP Helper (GetIpNetTable/GetIpNetTable2) for the ARP table and the Native Wi‑Fi hosted‑network functions (or a maintained managed wrapper) for peer MACs; map MAC→IP and optionally do reverse lookups for names.

Recommended Answers

All 2 Replies

The first step is to share how you do this now. Then automate that in VB.net.

I have found that almost all information about Windows config & status is available via a WMI query. Finding the correct query can be a problem but there is a great tool available to help.It is called scriptomatic. It's an HTA (html application). It's basically some vbscript code with a minimal gui (all in clear text) that generates vbscript code that you can copy/paste. You can download version 2.2 .

commented: Very nice. +15
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.