Output Windows username?

is there a way to output in Grasshopper the username of the user logged into the computer OR somehow extract the USERNAME in the UserObjects folder name…
C:\Users\USERNAME\AppData\Roaming\Grasshopper\UserObjects

Create a C# script component, use

https://docs.microsoft.com/en-us/dotnet/api/system.environment.username?redirectedfrom=MSDN&view=netframework-4.7.2#System_Environment_UserName

thanks jesterKing…within the component, besides the “public static string UserName { get; }” code, is there any additional code that needs to be added or a “return” added, as I’m not getting an output currently. any help is much appreciated!

I couldn’t be bother to find out how to add new assemblies to C# scripting component, so I did it just with a Python component. No inputs, and only one output called username, and code:

import System.Environment as env

username = env.UserName

username.gh (4.8 KB)

1 Like

awesome…worked perfectly…thanks!