简体   繁体   English

保护文件上传对话框

[英]Securing File Upload Dialog

I'm working on a project in C# on Windows XP where we have to capture a file dialog which allows users to select mulitple files (such as shown here: http://www.uploadify.com/demo/ ). 我正在Windows XP上使用C#进行的项目中,我们必须捕获一个文件对话框,该对话框允许用户选择多个文件(如此处所示: http : //www.uploadify.com/demo/ )。 Is it possible somehow to restrict access to local drives, such as C:, etc...? 是否可能以某种方式限制对本地驱动器(例如C:等)的访问? So the list of available drives would only contain drives that aren't excluded. 因此,可用驱动器列表将仅包含未排除的驱动器。

Thanks. 谢谢。

Probably the simplest way to do this would be to just write your own dialog which exposes only the drives you want. 可能最简单的方法是编写自己的对话框,仅显示所需的驱动器。 I don't think the standard dialog accepts flags which control which drives are shown. 我认为标准对话框不接受用于控制显示哪些驱动器的标志。

Having said that, there /is/ systemwide group policy that can be used to hide drives from ALL common file dialogs, but this would impact ALL applications. 话虽这么说,/ is /系统范围的组策略可用于从所有公用文件对话框中隐藏驱动器,但这会影响所有应用程序。

If you're building a kiosk, keep in mind that bad guys attack these things pretty regularly. 如果您要建造信息亭,请记住,坏人会经常攻击这些东西。 (See http://ikat.ha.cked.net/Windows/index.html , which is bizarrely, NSFW) (请参阅http://ikat.ha.cked.net/Windows/index.html ,这很奇怪,NSFW)

And why would you want to restrict this to local drives? 以及为什么要将此限制为本地驱动器? This is the work of the client, not the server. 这是客户端的工作,而不是服务器的工作。 You cannot force the client into this if they're using a standard web browser. 如果客户端使用标准的Web浏览器,则不能强制客户端这样做。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM