O'Reilly logo

Professional Silverlight® 4 by Bill Evjen, Jason Beres, Devin Rader

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 16. Working with File I/O

WHAT'S IN THIS CHAPTER?

  • Working with the OpenFileDialog and SaveFileDialog classes

  • Examining the class available for file and directory access

  • Silverlight and file access

  • Moving, copying, and deleting files

Invariably, most applications built deal with files in some fashion. It might be that your application needs to simply work from an XML configuration file or even store the end users' settings or data on a file on their machines. For this reason, this chapter looks at working with files in your Silverlight applications as well as other means to store content on the client's computer.

You have a couple of different means to work with files and folders with your Silverlight applications. Silverlight does supply file dialogs that allow you to get the end user to specify the actual file that your application is to work with. But, with Silverlight 4, you also have to get programmatic access to specific folders on the end user's system through the Environment.SpecialFolders object when running your Silverlight 4 application in an out-of-browser mode with elevated permissions.

THE OPENFILEDIALOG AND SAVEFILEDIALOG CLASSES

In working with files, one of the easiest means has been around even prior to Silverlight 4. Using the OpenFileDialog and SaveFileDialog classes has allowed you to work with files directly on the end user's desktop. However, working with files in this manner did include some overall limitations that caused Microsoft to further expand upon ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required