开发者

What is Silverlight/C# equivalent for Java's AccessController.doPrivileged

I'm try开发者_开发百科ing to do some filing with Silverlight and have access the result from Javascript. It is easily done by Java applets through the AccessController.doPrivileged method, for example I can write methods such as SaveToFile or ReadFromFile which are wrapped inside a AccessController.doPrivileged method, and it is done. I wanted to know how can I do the same thing with Silverlight, i.e., do some privileged stuff such as file IO therein.


By design (for security reasons), Silverlight code cannot access directly the host's file system.
A file may accessed, in reading mode only, if it is selected by way of the File Open Dialog.
The only limited capabilities for writing to files is when the Silverlight application is both ran in Out-of-Browser mode and in the context of Elevated trust. Yet such access is limited to particular well known directory locations (My Documents, My Music etc.)

Isolated storage provides a way for Silverlight applications to create, write and read files, but this type of access is generally "corralled"; again, Silverlight code does not have direct access to the host's file system.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜