c# - IsolatedStorageFile.DeleteFile doesn't work -



c# - IsolatedStorageFile.DeleteFile doesn't work -

i seek that:

using (isolatedstoragefile store = isolatedstoragefile.getuserstoreforapplication()) { if (store.fileexists(filename)) { store.deletefile(filename); } }

but have system.io.isolatedstorage.isolatedstorageexception: unable delete file.

what wrong?

so resolve problem using filemode.truncate on opening file.

using (isolatedstoragefile store = isolatedstoragefile.getuserstoreforapplication()) { using (var filestream = store.openfile(filename, filemode.truncate, fileaccess.readwrite, fileshare.readwrite)) { //do stuff } }

c# windows-phone-8 windows-phone

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -