WPF for Silverlight: What About Files-IOs?

We have a working WPF application that we view in a browser through Silverlight. There is a big question mark at the moment; what file access do we have (without jumping to many hoops)?

  • Can I open server files?
  • Can I open files on the client side?
  • Can we get notified about file changes (client or server side)?
  • Can normal open / seek / write / append operations be performed?

(A good link is welcomed as an answer)


0


a source to share


4 answers


  • Server side files: Not unless you serve them through a web service.
  • You can open files in two ways. One is isolated storage , an area where your application has a limited size (although you can ask the user to increase). In this, you can read, write and do what you want. If you need access to the hard drive, you can read only, and the file must be opened from a dialog box.
  • If you mean via FileSystemWatcher - no, not even isolated storage. On the server side, you can do what you want, obviously because this is not Silverlight. You can use duplex web services so that the server can notify your Silverlight application when something happens like a file change.
  • In isolated storage, you can do whatever you want. Also, these are read-only operations and the user must select a file from the Open File dialog box.


+3


a source


Make XBAP and deploy as full trust

Which application does yours have? first tell us that we can work out conclusions too!



UPDATE

0


a source


You won't be able to manipulate local files with silverlight without a rich client component. The client side component must expose the web service API and behave like a local web server. With this aproach you can do almost anything a regular WPF application can do.

-1


a source


  • "Can we open files on the server side?" - Yes, but web service is required (edited)
  • "Can we open files on the client side?" - Yes, only through the Open File window or files in isolated sotrage.
  • "Can we be notified of changes to files (client-side or server-side)?" - Yes, but only on the server side.
  • "Can we do normal open / seek / write / append operations?" With the System.IO.FileStream class, which is available in Silverlight, you can manipulate text streams in memory. However, you need to get the stream through web services by opening it with an open file or from isolated storage.
-1


a source







All Articles