I am developing an application which will run on Windows OS. However, when run it on Windows Vista, my application's settings is stored in VirtualStore. How to 开发者_StackOverflow社区check VirtualStore is being applied in my application (I need a function to check and it must ok on XP, Vista).
And how to get the path of Virtual Store of my application.
Thanks.
My workaround...
You get the user Appdata path:
String appdata = System.Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
Add VirtualStore folder to path:
String VirtualStoreRoot = appdata + "\\VirtualStore";
Create folder:
String backuppath = "C:\\Program Files\\Progname\\backup";
Directory.CreateDirectory(backuppath);
Check created in VirtualStore
String newpath = VirtualStoreRoot + backuppath.Substring(2);
if (Directory.Exists(newpath)){
backuppath = newpath;
}
I found another stuff:
Isolated Storage with .NET
精彩评论