I've a problem with an openFileDialog (default openFileDialog):
I've defined a filter (LogFiles|*.log)
for my OpenFileDialog. Works fine, users can only select *.log file in a folder.
But, if these *.log files are in a zip archive, as the zip extension is natively recognized like a folder(CompressedFolder) by Windows and zip files displayed on the left Treeview of OpenFileDialog window, users are able to select the .*log files in the archive (and I don't want that!)
The filename returned par OpenFileDialog in this case is the filename of a temporary extracted file, so it seems not possible to test if the selected file is a zipEntry.
I only see 2 solutions to solve my problem:
1°) Accessing the registry, backup and removing the HKEY_CLASSES_ROOT.zip to restore it later (very bad solution!)
2°) As the OpenFileDialog is a sealed class, implement my own OpenFileDialog which prevent the display of *.log files inside a zip
Are there any other solutions?
Thanks.