JL.
JL.

Reputation: 81292

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

I've noticed by default, Silverlight 4 applications 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?

Upvotes: 1

Views: 893

Answers (1)

Davita
Davita

Reputation: 9124

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

Upvotes: 2

Related Questions