开发者

referencing files in silverlight

开发者 https://www.devze.com 2023-03-09 08:18 出处:网络
If I reference a file in a silverlight project, is that file going to be looked at on the local pc or on the server (using silverlight 4 running in the browser)?

If I reference a file in a silverlight project, is that file going to be looked at on the local pc or on the server (using silverlight 4 running in the browser)?

For instance if I opened up a Stre开发者_如何学运维amReader and gave it "C:\test.txt" (assuming silverlight had permission to read that directory, which I assume in this trivial example it wouldn't)


If you had permissions for that file - which you don't, it would be on the local (client) side. A SL4 app running on the browser does not have permissions to acecss arbitrary files on the client computer. It does have access to a special location, the IsolatedStorage, which is located somewhere buried in the user directory, but you can't use a StreamReader directly to open a file from there, you need to use the IsolatedStorage classes to do it.

If you want to access a file on the server side, you need to explicitly expose it, for example using a web / WCF service.


pretty sure answer is local PC however question is not 100% clear.

Silverlight has no access to server file structure, except via web links . Its running on client machine and communicates to server by webserver calls usually.

0

精彩评论

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