CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    May 2008
    Posts
    3

    Document and settings/<userid> path

    Hello,

    I need to know the best way to get the Documents and settings/<userid> path in C#. I have googled a bit and not found what I need.

    Is there a better way that using; System.Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) and then removing the last directory name?

    Thanks

  2. #2
    Join Date
    Apr 2008
    Location
    Kentucky
    Posts
    73

    Re: Document and settings/<userid> path

    Code:
    string userFolder = "C:\\Documents and Settings\\" + Environment.UserName;
    Provided the folder is the same as their username, it would "work"... Other than that, I couldn't find any builtin function to retrieve exactly what you're looking for.

  3. #3
    Join Date
    May 2008
    Posts
    3

    Re: Document and settings/<userid> path

    Thank you, at least im not missing anything obvious and your idea was simpler than mine :-)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured