Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
GetAdaptersAddresses
Message
De
10/08/2016 16:24:18
 
 
À
10/08/2016 16:16:59
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
01639334
Message ID:
01639344
Vues:
59
>>>I want to try out this API function:
>>>
>>>ULONG WINAPI GetAdaptersAddresses(
>>> _In_ ULONG Family,
>>> _In_ ULONG Flags,
>>> _In_ PVOID Reserved,
>>> _Inout_ PIP_ADAPTER_ADDRESSES AdapterAddresses,
>>> _Inout_ PULONG SizePointer
>>>);
>>>
>>>How do I use that in VFP?
>>>
>>>See https://msdn.microsoft.com/en-us/library/windows/desktop/aa365915(v=vs.85).aspx for more detail
>>
>>If restricted to Vista and upwards, you may consider this alternative:
>>
>>
>>CLEAR
>>
>>LOCAL WMIService, AllNetworkAdapters, NetworkAdapter, MACAddress
>>
>>m.WMIService = GETOBJECT("winmgmts:\\.\root\cimv2")
>>
>>m.AllNetworkAdapters = m.WMIService.ExecQuery("Select * from Win32_NetworkAdapter",,48)
>>
>>FOR EACH m.NetworkAdapter IN m.AllNetworkAdapters
>>	m.MACAddress = m.NetworkAdapter.MACAddress
>>	IF !ISNULL(m.MACAddress)
>>		? m.NetworkAdapter.name + ": " + m.MACAddress + " (" + IIF(m.NetworkAdapter.PhysicalAdapter,"","not ") + "physical)"
>>	ENDIF
>>ENDFOR
>>
>>
>>Complete set of properties at https://msdn.microsoft.com/en-us/library/aa394216(v=vs.85).aspx
>
>Thanks, I've never felt comfortable that the WMI will always be available. I may be wrong, but it can be disabled, can't it?

Yes. But... https://msdn.microsoft.com/en-us/library/aa826517(v=vs.85).aspx
----------------------------------
António Tavares Lopes
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform