I am developing a Windows Application and I need to create a file in the following folder: My Documents\HWLocal77\Export
Here is the code that I am using:
string CensusFileName = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\HWLocal77\Exports\Census_" + curDate.Month.ToString() + curDate.Year.ToString() + ".txt"
When my code tries to open the file I get the following error message:
Could not find a part of the path 'C:\Users\username\Documen
In tracing the error, C:\Users\username exists. Documents folder does not exist but My Documents folder does.
Can anyone tell me what I need to change so I can access the My Documents\HWLocal77\Export
s folder regardless of which machine the application is installed on?