Autor Beitrag
JacK_Silent
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 30



BeitragVerfasst: Mo 05.11.07 12:23 
Gibt es eine Möglichkeit den Namen des W-LAN Netzes auszulesen, zu dem ich verbunden bin?

Zum einen aus Windows selbst und zum Anderen aus der INTEL Pro Set Wireless Software.

Vielen Dank
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Fr 09.11.07 15:13 
Such mal nach WMI hier im Forum, da gab's dazu schon ein wenig Source.

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
JacK_Silent Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 30



BeitragVerfasst: So 11.11.07 15:31 
ich hab folgendes gefunden:

MSDN: WlanGetAvailableNetworkList Function
msdn2.microsoft.com/...ibrary/ms706749.aspx

allerdings hab ich keine Ahnung wie ich das alles verwende!?!
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: So 11.11.07 16:05 
ausblenden C#-Quelltext
1:
2:
3:
4:
5:
6:
7:
DWORD WINAPI WlanGetAvailableNetworkList(
  __in        HANDLE hClientHandle,
  __in        const GUID* pInterfaceGuid,
  __in        DWORD dwFlags,
  __reserved  PVOID pReserved,
  __out       PWLAN_AVAILABLE_NETWORK_LIST* ppAvailableNetworkList
);

Heißt in Delphi:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
function WlanGetAvailableNetworkList(
  hClientHandle : THandle;
  const pInterfaceGuid: PGUID;
  dwFlags: DWORD;
  pReserved: Pointer;
  out ppAvailableNetworkList: PWLAN_AVAILABLE_NETWORK_LIST
): DWORD; stdcallexternal 'wlanapi.dll' name 'WlanGetAvailableNetworkList';


Weiterhin:

ausblenden C#-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
typedef struct _WLAN_AVAILABLE_NETWORK_LIST {
  DWORD dwNumberOfItems;
  DWORD dwIndex;
  WLAN_AVAILABLE_NETWORK Network[1];
} WLAN_AVAILABLE_NETWORK_LIST, 
 *PWLAN_AVAILABLE_NETWORK_LIST;

typedef struct _WLAN_AVAILABLE_NETWORK {
  WCHAR strProfileName[256];
  DOT11_SSID dot11Ssid;
  DOT11_BSS_TYPE dot11BssType;
  ULONG uNumberOfBssids;
  BOOL bNetworkConnectable;
  WLAN_REASON_CODE wlanNotConnectableReason;
  ULONG uNumberOfPhyTypes;
  DOT11_PHY_TYPE dot11PhyTypes[WLAN_MAX_PHY_TYPE_NUMBER];
  BOOL bMorePhyTypes;
  WLAN_SIGNAL_QUALITY wlanSignalQuality;
  BOOL bSecurityEnabled;
  DOT11_AUTH_ALGORITHM dot11DefaultAuthAlgorithm;
  DOT11_CIPHER_ALGORITHM dot11DefaultCipherAlgorithm;
  DWORD dwFlags;
  DWORD dwReserved;
} WLAN_AVAILABLE_NETWORK, 
 *PWLAN_AVAILABLE_NETWORK;


wird zu
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
type
    WLAN_AVAILABLE_NETWORK_LIST = record
        dwNumberOfItems: DWORD;
        dwIndex: DWORD;
        Network: record end;
    end;
    WLAN_AVAILABLE_NETWORK = record
        strProfileName: array[0..255of WideChar;
        dot11Ssid: DOT11_SSID;
        dot11BssType: DOT11_BSS_TYPE;
        uNumberOfBssids: DWORD;
        bNetworkConnectable: LongBool;
        wlanNotConnectableReason: WLAN_REASON_CODE;
        uNumberOfPhyTypes: DWORD;
        dot11PhyTypes: array[0..WLAN_MAX_PHY_TYPE_NUMBER-1of DOT11_PHY_TYPE;
        bMorePhyTypes: LongBool;
        wlanSignalQuality: WLAN_SIGNAL_QUALITY;
        bSecurityEnabled: LongBool;
        dot11DefaultAuthAlgorithm: DOT11_AUTH_ALGORITHM;
        dot11DefaultCipherAlgorithm: DOT11_CIPHER_ALGORITHM;
        dwFlags: DWORD;
        dwReserved: DWORD;
    end;
    PWLAN_AVAILABLE_NETWORK = ^WLAN_AVAILABLE_NETWORK;
    PWLAN_AVAILABLE_NETWORK_LIST = ^WLAN_AVAILABLE_NETWORK_LIST;


Der Rest sollte intuitiv zu übersetzen gehen.

Kleiner Hinweis zur Netzwerk-Liste:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
type 
    TNetworkListArray = array[0..0of WLAN_AVAILABLE_NETWORK;
    PNetworkListArray = ^TNetworkListArray
var
    WLANs: PWLAN_AVAILABLE_NETWORK_LIST;
    ANL: PNetworkListArray;
    i: Integer;
    WLANInfo: WLAN_AVAILABLE_NETWORK;
begin
    i := 0;
    ANL := @WLANs^.Network;
    for i := 0 To WLANs^.dwNumberOfItems - 1 do
    Begin
        WLANInfo := ANL^[i];
        //Do Something with WLANInfo ...
    end;
end;


Keine Garantie für die Korrektheit jeglicher Pointer ;-)

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
JacK_Silent Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 30



BeitragVerfasst: So 11.11.07 19:23 
Bin zu unfähig den von dir geposteten Code zu verwenden!