简体   繁体   English

如何欺骗Windows浏览对话框?

[英]How to cheat the windows Browse dialog?

I have an application where i use the windows browse dialog to select a file from the file system. 我有一个应用程序,使用Windows浏览对话框从文件系统中选择文件。 The application is written in C#, silverlight. 该应用程序是用C#Silverlight编写的。 My requirement is that when i select any particular file from this dialog, the user should be restricted to selecting only a set of files with a particular extension. 我的要求是,当我从此对话框中选择任何特定文件时,应限制用户仅选择一组具有特定扩展名的文件。 I have achieved this and the dialog only lists those files with the extension i permit. 我已经做到了,对话框仅列出了我允许的扩展名文件。 I am trying to break this by somehow letting the user select a file with a different extension from what is permitted. 我试图通过某种方式让用户选择扩展名与允许的扩展名不同的文件来打破这一点。 Is there a way to select a file from this dialog other than the one which is permitted ? 除了允许的对话框之外,是否有其他方法可以从该对话框中选择文件? Any user hacks ? 任何用户黑客?

PS: i dont want to change any code. PS:我不想更改任何代码。 I need this only for testing purpose with an intention to break the functionality. 我仅出于测试目的需要此功能,目的是破坏功能。

有一个非常简单的方法:用户只需在文件名框中键入*.* ,他就会看到所有文件。

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

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