Can OpenFileDialog receive filename *.*?
I want to use OpenFileDialog
as selecting file wit开发者_如何学Ch expression( . or *.zip) On File Name EditBox.
Do I have to override OpenFileDialog
? if then, please give me a tip about it.
At now, If I put file name as . and click 'open' , the OpenFileDialog doesn't return anything.
Sorry about my poor English.
Looks like you want to filter the possible file types of the file dialog. You can do that like this:
myOpenFileDialog.Filter = "Zip Files|*.zip";
If you want to allow several file types, you can just extend the list with several |'s
myOpenFileDialog.Filter = "Zip Files|*.zip|All Files|*.*";
You can't do what you want with OpenFileDialog
. It wraps up the common Windows component which has special treatment for file names that contain wildcards. Those are interpreted as filters for the file list view.
精彩评论