Windows Develop Bookmark and Share   
 index > Windows Forms General > getting the current user's profile
 

getting the current user's profile

Dear All,
Is there a way to get the path for the current user's MyDocuments folder ?
i.e  in my machine it is "C:\Documents and Settings\UserName\MyDocuments"

I know that we can get the current user name by the WindowsIdentity object's getCurrent method but what I want to get is that path for the user's MyDocuments folder

Any help is appreciated

Thankx
Sahan2  Tuesday, November 08, 2005 6:43 AM
There's not need to play around of current user's identity.
It's just that simple:

Environment.GetFolderPath(Environment.SpecialFolder.Personal));

Igor Sukhov  Tuesday, November 08, 2005 6:51 AM
There's not need to play around of current user's identity.
It's just that simple:

Environment.GetFolderPath(Environment.SpecialFolder.Personal));

Igor Sukhov  Tuesday, November 08, 2005 6:51 AM
Thankx alot


Sahan2  Tuesday, November 08, 2005 8:04 AM

You can use google to search for other answers

Custom Search

More Threads

• a simple printing problem, thanks for your help!
• RichTextBox to Word interop, a cleaner way than copy/paste?
• Image Align of a Button doesnt Work
• drawing outside a control by the control
• ListView Items Sorting
• ErrorProvider disabling all buttons on Windows form.
• problems with the webBrowser control and focus
• How to move a line drawn at runtime in C#?
• TabControl: Cancel Validating causes buttons on the tab page not responding to click event
• Help Displaying DICOM Image