Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to read ethernet card ID or MAC ID from VFP
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00944914
Message ID:
00944917
Vues:
15
Soykan!

>i wantto keep client pc ethernet mac addres infos on the server pc. application will install to the each client pc at the termial registration time i'll store the client pc MAC info to the eg MACINFO.DBF table . How can read directly this information several OS w9x,NT,2000,XP ?
>
>TIA

try this
* Program....:  TEST_GETADAPTERSINFO.PRG
* Version....:  1.0
* Author.....:  Dipl. Kfm. Frank Dietrich
* Date.......:  16.July 2003 
* Notice.....:  Copyright (c) 2003 
*               Frank Dietrich Datentechnik
*               Leo-Baeck-Str. 22
*               14165 Berlin
*               PHONE :	+49-30-845 777-0
*               FAX   :	+49-30-845 777-19
*  	       CIS   :	100322,333
*	       e-mail: frank.dietrich@dd-tech.de, All Rights Reserved.
* Compiler...:  Visual FoxPro 08.00.0000.2521 for Windows
* Abstract...:  Gebrauch der Funktion GetAdaptersInfo() 
*	       zur Ermittlung der lokalen IP-Adresse, MAC-Adresse
*	       etc.
* Changes....:


declare INTEGER GetAdaptersInfo IN iphlpapi;
STRING @pAdapterInfo, LONG @pOutBufLen

LOCAL lcBuffer, lnBufsize

lnBufsize = 4096
lcBuffer = Repli(Chr(0), lnBufsize)

IF GetAdaptersInfo(@lcBuffer, @lnBufsize) = 0

strToFile(strTran(lcBuffer, chr(0), ""), "test.txt")

? "Current IP address:", STRTRAN(SUBSTR(lcBuffer, 433,15), Chr(0),"")
? "Gateway:", STRTRAN(SUBSTR(lcBuffer, 473,15), Chr(0),'')
ENDIF


modi file test.txt
HTH
Regards from Berlin

Frank

Dietrich Datentechnik (Berlin)
Softwarekombinat Teltow (Teltow)

Frank.Dietrich@dd-tech.de
DFPUG # 327
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform