- Home /
How to retrieve system/computer name?
Hi there,
Is it possible at all to access the name of the Windows computer you are using, save that to a string and then use that as the player's name within the game? I understand how strings work etc, would just like to know how to access the user's PC name... is this possible with Unity?
Cheers!
Answer by AVividLight · Jul 01, 2012 at 05:00 AM
In C#, use System.Environment.UserName (http://msdn.microsoft.com/en-us/library/System.Environment.aspx). I'm afraid I can't help you in JavaScript.
P.s. This works on Mac and Windows... Just thought I'd mention that
-Do your best! Gibson
Thanks for that! I'm sure I'll be able to get that working :)
That's not C#, that's .NET, which works the same in all languages.
Your answer
Follow this Question
Related Questions
Checking that this String is in this Array 3 Answers
NullRerenceException On comparisons 0 Answers
Using Buttons to write numbers 3 Answers
If String.Contains an item from List ? 1 Answer
script ignoring variables when assigning them in the hierarchy 0 Answers