开发者

How to allow silverlight to read any file on the file system, not just my documents?

I've noticed by default, Silverlight 4 applica开发者_StackOverflowtions only have read access to my documents.

Is there anyway to trust a silverlight application so that it can open a file from any location on the file system.

I can't expect my users to first have to copy files into the my documents folder before upload, is there a way to fully trust a particular silver light app?


Directly no. Silverlight doesn't provide it's own API to access file system outside My Documents. But you can always use COM in elevated trust applications to access any file in the system.

    dynamic Fso = AutomationFactory.CreateObject("Scripting.FileSystemObject");
    fso.CreateFolder("D:\\SilverFolder");

http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.automation.automationfactory(VS.95).aspx http://msdn.microsoft.com/en-us/library/ee721083(VS.96).aspx

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜