Here is the code.
I retrieve 3 times the SSID.
Did I made a mistake ?
begin
locator := TSWbemlocator.Create(self);
Services := locator.ConnectServer('', 'root\WMI', '', '', '', '', 0, nil);
memo1.Clear;
ObjSet := Services.ExecQuery('SELECT * FROM
MSNdis_80211_ServiceSetIdentifier where active=true',
'WQL', wbemFlagReturnImmediately, nil);
Enum := IUnknown(ObjSet._NewEnum ) as IEnumVariant;
while (Enum.Next(1, tempObj, Value) = S_OK) do
begin
Obj := IUnknown(tempObj) as SWBemObject;
PropSet := Obj.Properties_;
propEnum := IUnknown(PropSet._NewEnum) as IEnumVariant;
while (propEnum.Next(1, tempObj1, Count) = S_OK) do
begin
Prop := IUnknown(tempObj1) as SWBemProperty;
result:='';
if ansicomparestr(
prop.name, 'Ndis80211SsId')=0 then
begin
if VarIsArray(prop.Get_Value) then
begin
if VarArrayHighBound(prop.Get_Value, 1) > 0 then
for Count := 1 to VarArrayHighBound(prop.Get_Value, 1) do
begin
i:=prop.Get_Value[Count];
if i<>0 then
Result := Result + chr(i);
end;
end
else Result := IntToStr(prop.Get_Value);
memo1.Lines.Add(
prop.name + ' ' + result);
end;
// memo1.Lines.Add(GetValue(prop.Name, mo));
end;
end;