问题
I know I can write a custom dialog to do what I'm looking for, but is it possible to set a filter with OpenFileDialog to get .txt files, but only if they doesn't have "_org" in the filename?
回答1:
Hey you can subscribe the OpenFileDialog.FileOk-Event to check the user selection of file names. if any filename incorrect you can cancel the event an show a message! otherwise you must write a custom dialog.
回答2:
It is not possible with Basic OpenFileDialog's Filter property as it just filters list of files based on their extension.
来源:https://stackoverflow.com/questions/25625063/openfiledialog-filter-out-files-with-specific-words