1

Say I have created a few Directories in IsolatedStorage. Here are my problems:
1) How do I change the name of the Directory in IsoloatedStorage?
2) What happens to the files stored in the directory which I have change the name.
3) How do I change the file name that stored in Isolatedstorage Example :
MyCity.txt to FunCity.txt

Thanks

MilkBottle
  • 4,242
  • 13
  • 64
  • 146

1 Answers1

0

You'll have to copy the files and write them again with a new name as described in this post. You can then delete the old file/directory using the DeleteFile or DeleteDirectory methods.

If you're creating a Mango app, then you have access to the MoveFile and MoveDirectory methods.

Community
  • 1
  • 1
keyboardP
  • 68,824
  • 13
  • 156
  • 205
  • Using old wp7 version. People are saying wait til the Mango RTM version for development. Thank for the filename changing method. But There is no Directory name changing method. I need this for pre-mango version for case1. Change directory name where there is no file in it. case 2. Change directory name where there r files in it. Thanks – MilkBottle Jun 03 '11 at 02:42
  • @MilkBottle - 1) Simply create a new directory and delete the old one. 2) You'll have to think about the order you want to do this is in to get the most efficiency. You can't rename a directory, but you can create a new one. So create a new directory and copy (using the code in the link above) your old files within that directory to the newly created directory. Then delete the old directory. As for Mango, I was just putting that statement for completeness. If you create a Mango app now, you won't be able to submit it yet anyway. – keyboardP Jun 03 '11 at 02:44
  • Thank u very much. It seems it is very messy when come to deleting directory with files( more than 10). So, I have to copy all the files to new Directory FIRST till finish then i can delete the old directory. Work on it now. We report back. Thanks – MilkBottle Jun 03 '11 at 03:05