string path = @"e:\MyTest.txt";
FileInfo fi1 = new FileInfo(path);
if (!fi1.Exists)
{
//Create a file to write to.
using (StreamWriter sw = fi1.CreateText())
{
sw.WriteLine("Hello");
sw.WriteLine("And");
sw.WriteLine("Welcome");
}
}
listBox1.Items.Add(fi1.Name);
int gf = this.listBox1.Items.IndexOf(fi1.Name);