5
In a Windows Forms application I would like to know how to search all the files that exist and contain the word teste
in the file extension. For example, when opening a folder in Windows and typing *.teste*
in the search field will be returned all files containing that word in its extension regardless if it is .teste1
, .teste2
...
string Diretorio = @"C:\teste\";
string Arquivo = Diretorio + Codigo.Trim() + "E" + "\" + Data;
if (File.Exists(Arquivo + ".teste"))
{
Retorno = true;
}
In the code fragment above, the word teste
was set to a file extension. However if I have the file with the extension .teste1
or .teste2
the file will no longer be found.
type a LIKE in the extension?
– Wees Smith
Yeah, like a like
– Moisolas
but I believe it is not possible, exists checks the existence or not of the specified file only
– Wees Smith