Silverlight访问文件路径 [英] silverlight access to file path

查看:84
本文介绍了Silverlight访问文件路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Silverlight应用程序,并且需要一种方法来查找所选文件的物理路径.

I have a Silverlight application and I need a way to find out the physical path for a selected file.

注意::我了解一些安全限制,即在客户端中禁止获取路径.

Note: I know about security restrictions that obtaining the path is prohibited in client.

我有一个解决方案,但是我不确定它是否有效:silverlight应用程序与允许执行受限操作的ActiveX组件一起在页面中运行. Silverlight应用程序要求ActiveX组件执行特权操作,然后返回路径.

I have in mind a solution but I am not sure it works: silverlight app is running in a page together with an ActiveX component that is allowed to do restricted operations. The Silverlight app asks the ActiveX component to do the privileged operations and returns back the path.

这是一种有效的方案还是有一种更简单的方法?

Is that a valid scenario or there is a simpler way?

推荐答案

您可以使用公共文件打开对话框,让用户告诉您文件的位置.这将是这样做的安全方法,而不会损害用户的系统.

You can use the common file open dialog and let the user tell you where the file is. This would be the secure way to do it, w/o compromising the user's system.

如果您以Full-Trust运行,您可能可以得到它. 查看此文章,它可能会有所帮助.

You might be able to get it if you run in Full-Trust.... check out this article, it might help.

这篇关于Silverlight访问文件路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆