Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Changing Computer Name
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00529361
Message ID:
00529370
Vues:
15
>Hi,
>
>I was wondering if there's anyway to change computer name trough VFP, and whether I can read the computer ethernet address.
>
>Thank you.

You can use the SetComputerName function of the WinAPI:
declare integer SetComputerName in kernel32 string
declare integer GetLastError in kernel32

lcnewname = "MyNewName"+chr(0)  && null terminated string
if SetComputerName(lcnewname) = 0 then
   * it failed, return error number
   ? GetLastError()
else
   * everything okay
endif
As for the ethernet address, take a look atthis message concerning retrieving the IP address http://www.levelextreme.com/wconnect/wc.dll?FournierTransformation~?2,15,526831.

HTH.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform