I considering writing an application in C#/.NET that will programmatically alter an XML file on a user’s computer and I trying to determine if Silverlight (and which versions, in what modes) will work for this task.
Here’s the workflow:
- User selects file
- Application modifies file
- Application saves file, overwriting original file
Is this possible in Silverlight? If so, in which versions and under what conditions?
Some answer here concentrate on Isolated Storage. If no other application need access this data then perhaps Isolated Storage is the answer for you. This link is a blog describing how you Isolated Storage is used in a nutshell.
I suspect this possibly isn’t what you want since you have the user select the file.
Certainly in SL3 you can have the user select the file and then you can read it.
However in order to save it again you would have to have to show a “Save File” dialog to the user, to aquire a File Stream you can write to.
In SL4 running OOB with elevated privs you can save files like this directly in the users folder such as My Documents.
Edit
Just to be absolutely clear, you cannot write to a file that was acquired using the
OpenFileDialogonly read, you cannot read to a file that as acquired usingSaveFileDialogonly Write.