Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
To capture mac adresses with VFP7.0
Message
De
15/07/2004 05:20:20
 
 
À
14/07/2004 10:01:30
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00924191
Message ID:
00924573
Vues:
7
Lazaro, I knocked up some sample code for you.

You need to tidy it and bullet proof it, but it shows you how to get the stuff that you are after.

Mace

************************************************************************************************
LOCAL lcIP
LOCAL lnAddr
LOCAL lnBuffer
LOCAL lcMacAddr
LOCAL lcMacAddress
LOCAL lnLoop

DECLARE INTEGER inet_addr IN ws2_32 STRING
DECLARE INTEGER SendARP IN "iphlpapi.dll" LONG, LONG, STRING @, LONG @


lcIP = "10.149.26.135" + CHR(0)
lnAddr = inet_addr( lcIP)
?lnAddr
lcMacAddr = SPACE(256)
lnBuffer = 12
?SendARP( lnAddr, 0, @lcMacAddr , @lnBuffer)
?lcMacAddr

lcMacAddress = "00-"

FOR lnLoop = 1 TO lnBuffer-1
lcMacAddress = lcMacAddress + RIGHT(TRANSFORM( ASC( SUBSTR( lcMacAddr, lnLoop + 1, 1)), "@0"), 2) + "-"
ENDFOR

lcMacAddress = LEFT( lcMacAddress, LEN( lcMacAddress) - 1)
?lcMacAddress

*************************************************************************************************************
>Hi !!
>
>Someone have one routine VFP7.0 that capture the mac adresses or serial number of a machine in my network ?
>
>I want to execute this code in machine1 but get this information of other machine passing as parameters the name this machine.
>
>I already tryed and not obtain sucess.
>
>Thanks.
>
>Lázaro Santos.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform