Click here to Skip to main content
15,909,498 members

Comments by ShakalX (Top 30 by date)

ShakalX 22-May-18 16:25pm View    
I have another question. To search for a file in all folders and subfolders. I'm trying like this. but that does not work. Just find the file if by the way full path folder.

string[] ext = new string[1] { "*.CSB" };

foreach (string found in ext)
{
string[] extracted = Directory.GetFiles("C:\\ProgramData", found, System.IO.SearchOption.AllDirectories);

foreach (string file in extracted)
{
Console.WriteLine(file);
MessageBox.Show(file);
}
}
like this work

string[] ext = new string[1] { "*.CSB" };

foreach (string found in ext)
{
string[] extracted = Directory.GetFiles("C:\\ProgramData\\NewCBProg", found, System.IO.SearchOption.AllDirectories);

foreach (string file in extracted)
{
Console.WriteLine(file);
MessageBox.Show(file);
}
}
ShakalX 22-May-18 11:57am View    
Deleted
thanks.
ShakalX 22-May-18 11:55am View    
Very thanks.
ShakalX 20-May-18 14:25pm View    
work if use SearchOption.TopDirectoryOnly, but i if i need "ASCF" or "1SCF" ? Possible use if Contains?
ShakalX 20-May-18 12:43pm View    
i try but no work. =/