how to identity my pc
BlitzMax Forums/BlitzMax Beginners Area/how to identity my pc
| ||
i need a way to get the computername or the mac adress . it must works on win/linux and hopefully mac |
| ||
Windows:Print getenv_("username")Edit: This returns the current username on Windows, NOT the Computer-Name. Not sure about the others. |
| ||
This should give you the computer-name on all platforms:Print HostName(0) |
| ||
Using getenv_() I got my actual computer name 'Tim', using HostName(0) I got 'tim-main' - which is my network name. Something doesn't seem right. |
| ||
using getenv_() I got my actual computer name 'Tim', using HostName(0) I got 'tim-main' - which is my network name. Something doesn't seem right. I thought "computer name" and "hostname" were the same thing... ? Getting the username wouldnt allow you to identify the computer anyway, you need the hostname (multiple users and all). |
| ||
They are... |
| ||
not. I don't know why hostname is getting my network name. If I go My Computer->Computer Name->'Change...' it shows 'tim-main' and my windows login username is 'Tim'. Getting the username wouldnt allow you to identify the computer anyway, you need the hostname (multiple users and all). No, hostname would not work, I could simply change my 'computer name' to whatever I want and whatever hes using hostname for would be broken. Best bet is to get the MAC address. |
| ||
Sweet baby Jebus! |
| ||
I don't know why hostname is getting my network name. Because they're the same thing!If you want to get your user account name, that's another matter entirely. Grable's reply is the correct solution to the original problem. |
| ||
They are... :P |