问题
When building a Silverlight 4 application is it possible to get a directory listing from an in browser application?
It seems the SaveFileDialog does not have the capability to set the file name of the file being saved, so I thought that I could create my own user control, however it seems that is not possible as I can't get a directory listing in an in-browser application.
I realize that certain well known
directories are accessible from Silverlight 4 in out-of-browser application, but that doesn't help an in-browser application.
回答1:
In-browser Silverlight apps are constrained by the sandbox, so from a file I/O perspective it's not much different from SL3 in the sense that you really have no access to the file system outside of Isolated Storage. Of course, a user can specify whatever directory they want to save a file in but you cannot specify it for the user - it's 100% the user's call on where a file is stored, and client-side file storage outside of Isolate Storage must be user-initiated.
来源:https://stackoverflow.com/questions/4167198/in-browser-silverlight-application-client-side-file-directory-access