There are special folders to get to users docs etc, as any advanced user will move their documents away from the default to a non-system drive.
On 13 Dec, 01:41, BBetances <[email protected]> wrote: > Here's a good question, and the answer is probably right in from of > me. > > I want to retrieve the name of the user that is logged in on a certain > PC from C#. Let me give you an example. > > I'm making a media player (web based) that can play videos, music, and > images. As many of you know, the default location of most people's > media is "C:/Users/'Username'/Documents/Music || Movies || Pictures". > The username variable is the name you use to login to your computer. > For example, mine is Administrator. I use AD, but for those that don't > connect to a domain, I want to be able to retrieve that name as well. > This name will be added into the above string to define a default > location to load media from. So, lets say someone uses Windows XP > Home, which does'nt allow connection to a domain, and they login with > the name "Jojo9696". How can I find that name in C#, so I can > construct my path string? > > I know this question is kind of complicated, or maybe just asked > wrong, but think of it like this: When you click your start menu, and > it tells you the name you used to log into your computer, I want to > retrieve that name. > > Any ideas?
