string[] first = File.ReadAllLines("file1.txt");
string[] second = File.ReadAllLines("file2.txt");
string[] third = File.ReadAllLines("file3.txt");
using (StreamWriter sw = new StreamWriter("result.txt"))
{
for (int i = 0; i < first.Length; i++)
sw.WriteLine("{0}, {1}, {2}", first[i], second[i], third[i]);
}
this is the code i used..it's just that i should not put "file1.txt" but the program should automatically search for it and be able to perform the operation..how am i going to do it??if you can provide me with a helpful code..thanks in advance.
how am i going to use the directoryinfo to get the files??tnx..

0 answers