Joker for a digit in File Dialog Filter

  • Thread starter Thread starter Phil
  • Start date Start date
P

Phil

Hi All!

I would like to filter files, in a file dialog, with
digits in extension only, i.e., files with extensions
from *.000 to *.999. Since I could not find a joker for a
digit, I made a filter in a brute-force way:

fileDialog.Filter = "Test files (*.000 - *.999)|";
int i;
for(i = 0; i < 999; i++)
fileDialog.Filter += "*." + i.ToString("000") + ";";
fileDialog.Filter += "*." + i.ToString("000") + "|All
files (*.*)|*.*";

Although the fileDialog.Filter is complete (i.e., it is
not truncated), choosing "Test files (*.000 - *.999)|" in
a file dialog filters only files with extensions from
*.000 to *.042. Does anyone know how to filter the whole
range?

Happy New Year to all of you,
Phil
 
Hi Phil,

The length of the filter is quite limited, so generating the filter in the
brute-force way won't work just due to the length limitations. On the other
hand, as far as I know, the filter only recognizes good old DOS * and ?
wildcards, and does not allow for regular expressions or something like
that.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top