Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Changing Computer Name
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00529361
Message ID:
00529370
Views:
14
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform