470,848 Members | 1,653 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,848 developers. It's quick & easy.

OpenFileDialog throws "Illegal characters in path"

Hi,

I have a OpenFileDialog on my windows form whose filter is *.*.
I want the users to be able to further filter the files by giving *.doc
or *.zip etc in the "file name" field of the dialog (Just like it
happens in the open file dialog of MS Word)
Currently, if the user enters a wild card character in the file name
field, it is throwing an exception with the message "Illegal characters
in path".
Please let me know how to achieve the above mentioned functionality.

Regards,
Shilpa

May 29 '06 #1
1 2146
Shilpa wrote:
Hi,

I have a OpenFileDialog on my windows form whose filter is *.*.
I want the users to be able to further filter the files by giving
*.doc or *.zip etc in the "file name" field of the dialog (Just like
it happens in the open file dialog of MS Word)
Currently, if the user enters a wild card character in the file name
field, it is throwing an exception with the message "Illegal
characters in path".
Please let me know how to achieve the above mentioned functionality.


OpenFileDialog is meant to open a single file OR a set of files which
are selected inside the dialog. So it's not meant to offer the user a
textbox in which the user can type in a wildcard filter.

this thus means that if the user types in a *, the dialog assumes it's
a path / filename character which gives this exception as * isn't a
legal character for a filename.

FB

--
------------------------------------------------------------------------
Lead developer of LLBLGen Pro, the productive O/R mapper for .NET
LLBLGen Pro website: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
May 30 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by BenO | last post: by
2 posts views Thread by Kostatus | last post: by
reply views Thread by Felix Finch | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.