C# Windows Active User
Go to solution
Solved by lubblig,
You use something called an environment variable
%userprofile% takes you to the current user's folder, then %userprofile%\Desktop takes you to the desktop.
(It's not just C#, try it out in windows explorer
)
Here are some more ones that are set by default in Windows that you may find useful:
http://ss64.com/nt/syntax-variables.html
(You can set custom ones too, for example things like the java path can be set)
You can also use the following command (for C#):
Environment.GetFolderPath(Environment.SpecialFolder.PLACE);
Where PLACE is where you what folder you want. If you type this and after SpecialFolder enter the dot. The intellisense will show and give you the different options.
This can be stored in a string btw.
It'll look like this:


Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now