[沒有蠢問題] C# 抓當前連線 WIFI SSID

  • 94
  • 0
  • 2022-01-23

C# 抓當前連線 WIFI SSID

安裝套件

https://www.nuget.org/packages/Microsoft-WindowsAPICodePack-Core/

            var networks = NetworkListManager.GetNetworks(NetworkConnectivityLevels.Connected).ToList();
            foreach (var network in networks)
            {

                var sConnected = ((network.IsConnected == true) ? " (connected)" : " (disconnected)");
                Console.WriteLine("Network : " + network.Name + " - Category : " + network.Category.ToString() + sConnected);
            }
            Console.ReadLine();

如果內容有誤請多鞭策謝謝