问题描述:

I tried to access to IsolatedStorage by using method IsolatedStorageFile.GetUserStoreForApplication, I saw IsolatedStorageFile.RootDirectory (non-public members) as "C:\Users\{USER_NAME}\AppData\Local\IsolatedStorage\43fdwhta.5sf\pamkspbu.odm\StrongName.4lepksw5iyzrojmfb200kvmstgrwryq2\AppFiles\" while debugging. But when i'm trying to get all files and folder, using GetFileNames() and GetDirectoryNames(), I got nothing.

Could anyone tell me where I'm wrong and how to fix this?

I'm using vs2005, .NET 2.0 and Caching block

(Microsoft.Practice.EnterpriseLibrary) is obsoleted.

网友答案:

thanks @Apoorv. I created some files and folder in directory AppFiles, and when I'm using GetFileNames() or GetDirectoryNames(), it works.

Now I have an another problem. My application was published by Clickonce, and use this path to store some files (yours will be different): [MY_SYSTEM_DRIVE]\AppData\Local\IsolatedStorage\nno4i433.35v\rwjd1oqb.vbw\Publisher.fcwcazqh0wlfeowj0g3bb1rh4ho12mbw\Publisher.wobgdc0ahsmraeplqqlxnqg12riflrpx\Files

I want to locate to Publisher folder, by trying: IsolatedStorageFile.GetStore(IsolatedStorageScope.User | IsolatedStorageScope.Assembly | IsolatedStorageScope.Domain, typeof(System.Security.Policy.Publisher), typeof(System.Security.Policy.Publisher)); but it's not working and throw an exception Unable to determine identity of assembly. Can you help?!

相关阅读:
Top