This code works in XP;
...
pqsResult = Marshal.AllocHGlobal(bufferSize);
result = Functions.WSALookupServiceNext(valHandle, dwControlFlags, ref bufferSize, pqsResult);
if (0==result)
{
Marshal.PtrToStructure(pqsResult, qsResult);
Network network = GetNetworkDetails(qsResult);
networkConnections.Add(network);
}
else
{
CheckResult(result);
}
Marshal.FreeHGlobal(pqsResult);
...
But will not work on Vista as all network adaptors will return 0 as speed, stay tuned for workaround using System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces()...
Abonner på:
Legg inn kommentarer (Atom)

Ingen kommentarer:
Legg inn en kommentar