Windows temporary file path to use when end-user has roaming profile and network access is problematic

60 Views Asked by At

I have a .NET WinForms application which uses a WebBrowser control. The application generates an html file to the users ApplicationData folder and then loads it into the WebBrowser control. This normally works fine, but there is a user that has restricted IE settings, and also is using a roaming profile. Therefore, the ApplicationData is located on a network drive and the html file fails to load because the security settings prevent loading a html file from a network location. Adding a security exception to that location is possible, but undesirable.

Is there another special folder that would be appropriate for this data, not require admin rights to write to, and be guaranteed to reside on the local machine?

1

There are 1 best solutions below

0
user109078 On BEST ANSWER

So I was using:

Environment.SpecialFolder.ApplicationData

which corresponds to Root/Users/theUserName/AppData/Roaming

The solution is to use:

Environment.SpecialFolder.LocalApplicationData

which corresponds to Root/Users/theUserName/AppData/Local

Note that the corresponding directories are for Vista and newer.