使用Silverlight OpenFileDialog从文件中获取全名是永远不可能的吗? [英] Is it never possible to get the FullName from a file using Silverlight OpenFileDialog?

查看:70
本文介绍了使用Silverlight OpenFileDialog从文件中获取全名是永远不可能的吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从Silverlight OpenFileDialog上的文件中获取全名,当我尝试这样做时,Silverlight抛出错误.

I want to get the fullname from a file on Silverlight OpenFileDialog, when I try that, Silverlight throws me an error.

我看到FullName上有一个属性,说它是[SECURITY CRITICAL],但是我需要显示完整路径,难道我真的无法做到这一点吗?

I saw there is an attribute on FullName saying it is [SECURITY CRITICAL], but I need to display the full path, is it really no way I can do that?

推荐答案

OpenFileDialog不会仅仅因为不希望您更改这些文件而提供全名.使用Silverlight,您只能访问隔离存储,并且文件可能位于该存储之外. 但是您可以打开文件并复制到孤立的存储中,然后在其中进行修改.
刚刚发现 bassfriend 也找到了此链接并将其发布到上方.我的错.再一次,该链接在Google的前20名中. :-)

OpenFileDialog won't provide the full name simply because it doesn't want you to alter those files. With Silverlight, you only have access to the isolated storage and the file could be located outside this storage. But you could just open the file and copy it to the isolated storage, and modify it there.
Just discovered that bassfriend found this link too and posted it above. My mistake. Then again, the link is in the top-20 of Google. :-)

您将无法获得完整文件名的另一个原因是,该文件名可能包含敏感信息.例如,我的文档"文件夹中的文件可能会显示用户登录名.

Another reason why you won't get the full filename is because that filename could contain sensitive information. For example, a file in the "My Documents" folder could expose the user login name.

基本上,这是一个安全限制.即使有可能,您也不应该绕过它.如果您能找到解决方法,MS可能会发布安全更新以再次关闭该漏洞...

Basically, it's a security restriction. You're not supposed to bypass it, even if it would be possible. If you would find a way around this, MS would probably release a security update to close that leak again...

这篇关于使用Silverlight OpenFileDialog从文件中获取全名是永远不可能的吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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