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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement