I am saving images and files to Environment.SpecialFolder.Personal. Saving a file is easy, but how does one delete a file?
I wish to delete files that my program considers old, so that I save as much space as possible.
I am using Monotouch to develop an iPhone application, but I believe this can apply to generic .NET programs as well.
Where filename is
Path.Combine( Environment.GetFolderPath ( Environment.SpecialFolder.Personal ), "TODELETE.ext" );Using
Directory.GetFiles ()you can get all the files of the folder.Than get a
FileInfoobject from each to figure out size, creation date, etc.Delete whatever you consider old enough.