O'Reilly logo

Pro Silverlight 5 in VB by Matthew MacDonald

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

Accessing Files Outside of Isolated Storage

As you've seen, Silverlight applications aren't allowed to browse the file system. But you can use several back doors to read and write individual files—provided the user selects them first. These back doors are the OpenFileDialog and SaveFileDialog classes and the drag-and-drop feature.

The OpenFileDialog and SaveFileDialog classes allow you to show a standard Open and Save dialog box in response to a user-initiated action (like a button click). The user then selects a file in the dialog box, which is returned to your code as a stream. If you show the Open dialog box, you get given a read-only stream for accessing the file. If you show the Save dialog box, you get a writeable stream. Either way, the ...

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