Reputation: 595
I would like to read from a htm file, that is located to the following directory:
C:\Users\**NAME**\AppData\Roaming\Microsoft\Signatures
How can I change the path, so that I can use it from another computer, where the user name is not equal to the one above?
DirectoryInfo directoryInfo = new DirectoryInfo(Environment.SpecialFolder.ApplicationData + @"Roaming\Microsoft\Signatures");
Upvotes: 0
Views: 90
Reputation: 13920
Try this:
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData,Environment.SpecialFolderOption.None) + @"\Microsoft\Signatures"
Check also the possibility of parameter Environment.SpecialFolderOption
Upvotes: 0
Reputation: 9975
Environment.SpecialFolder
is an enumeration, you need to call GetFolderPath
to get the actual path. Also ApplicationData includes the "Roaming" part, so you don't need that
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\Microsoft\Signatures"
Upvotes: 1