.GetFiles(?)
-
Hello, what i have is this foreach( FileInfo f in di.GetFiles("*.txt")) { //do something } foreach( FileInfo f in di.GetFiles("*.log")) { //do the same thing } what i wan't is this foreach( FileInfo f in di.GetFiles("*.txt, *.log")) { //do something } but di.GetFiles("*.txt, *.log") returns nothing. can i put in a RegEx or something?
Ronald Hahn, CNT - Computer Engineering Technologist New Technologies Analyst HahnTech Affiliated With Code Constructors Edmonton, Alberta, Canada Email: rhahn82@telus.net
-
Hello, what i have is this foreach( FileInfo f in di.GetFiles("*.txt")) { //do something } foreach( FileInfo f in di.GetFiles("*.log")) { //do the same thing } what i wan't is this foreach( FileInfo f in di.GetFiles("*.txt, *.log")) { //do something } but di.GetFiles("*.txt, *.log") returns nothing. can i put in a RegEx or something?
Ronald Hahn, CNT - Computer Engineering Technologist New Technologies Analyst HahnTech Affiliated With Code Constructors Edmonton, Alberta, Canada Email: rhahn82@telus.net
Nope, you're pretty limited in this regard. Maybe an alternative is to pair up the collections:
List lst = new List();
lst.AddRange(di.GetFiles("*.txt"));
lst.AddRange(di.GetFiles("*.log"));
foreach (FileInfo fi in lst) { ... }If you want them to be in a particular order, then you can just call
Sort()
.
-
Nope, you're pretty limited in this regard. Maybe an alternative is to pair up the collections:
List lst = new List();
lst.AddRange(di.GetFiles("*.txt"));
lst.AddRange(di.GetFiles("*.log"));
foreach (FileInfo fi in lst) { ... }If you want them to be in a particular order, then you can just call
Sort()
.
Setteled on this foreach( string f in Directory.GetFiles(_ControleFileBucket)) { if( f.EndsWith("*." + CDoc.EmailCF) || f.EndsWith("*." + CDoc.FaxCF)||f.EndsWith("*." + CDoc.GMailCF)) { ...
Ronald Hahn, CNT - Computer Engineering Technologist New Technologies Analyst HahnTech Affiliated With Code Constructors Edmonton, Alberta, Canada Email: rhahn82@telus.net