Delphi Easily Iterate Through Known Wifi Networks On Windows Through Code

FireWind

Свой
Регистрация
2 Дек 2005
Сообщения
1,957
Реакции
1,203
Credits
4,034
Easily Iterate Through Known Wifi Networks On Windows Through Code
By Anbarasan March 22, 2021

Sometimes Developers need to list down the known Wi-Fi Networks and its configurations from a Delphi App programmatically? Don’t know how to do. Don’t worry. Для просмотра ссылки Войди или Зарегистрируйся System Information Management Suite’s helps to enumerate the Known Wi-Fi Networks , we will learn how to use the MiTeC_WLANC Component in this blog post.

Platforms: Windows.

Installation Steps:

You can easily install this Component Suite from GetIt Package Manager. The steps are as follows.
  1. Navigate In RAD Studio IDE->Tools->GetIt Package Manager->select Components in Categories->Components->Trail -MiTec system Information Component Suite 14.3 and click Install Button.
  2. Read the license and Click Agree All. An Information dialog saying ‘Requires a restart of RAD studio at the end of the process. Do you want to proceed? click yes and continue.
  3. It will download the plugin and installs it. Once installed Click Restart now.
How to run the Demo app:
  • Navigate to the System Information Management Suite trails setup, Demos folder which is installed during Get It installation e.g) C:UsersDocumentsEmbarcaderoStudio21.0CatalogRepositoryMiTeC-14.3DemosDelphi26
  • Open the WLANC project in RAD studio 10.4.1 compile and Run the application.
  • This Demo App shows how to list down the Wi-Fi Network, enumerate among them and access its configuration properties.
Components used in MSIC WLANC Demo App:
  • TMiTeC_WLANC gathers information about known Wi-Fi networks and their configurations.
  • TListView to show the Known Wi-Fi Network and its properties.
  • TButton to save the listed Wi-Fi Network to a .sif file and close the application.
Implementation Details:
  • An Instance is created WLANC of TMiTeC_WLANC. Loop through the WLANC Record count and add Network configurations item to the list view. List down the properties such as SSID, Key, Authentication, Encryption, Adapter Name, IP address Timestamp etc. of each TWLANRecord item to list view subitems.
Код:
procedure TForm2.RefreshData;
var
  i: Integer;
begin
  Screen.Cursor:=crHourglass;
  try
    WLANC.RefreshData;
    List.Items.Clear;
    for i:=0 to WLANC.RecordCount-1 do
      with List.Items.Add do begin
        Caption:=WLANC.Records[i].SSID;
        SubItems.Add(WLANC.Records[i].Key);
        SubItems.Add(WLANC.Records[i].Authentication);
        SubItems.Add(WLANC.Records[i].Encryption);
        SubItems.Add(WLANC.Records[i].Connection);
        SubItems.Add(WLANC.Records[i].AdapterName);
        SubItems.Add(WLANC.Records[i].IPAddress);
        SubItems.Add(DateTimeToStr(UTCToLocalDatetime(WLANC.Records[i].Timestamp)));
      end;
  finally
    Screen.Cursor:=crDefault;
  end;
end;
  • Display the known Wi-Fi Network properties as shown below.
1616442107163.png
It’s that simple to enumerate known Wi-Fi Networks and list its configuration details for your application. Use this MiTeC component suite and get the job done quickly.