read text file from text box if text box is exist
up vote
-3
down vote
favorite
const string baseFolder = @"C:\Users\Zuhaib Asim\Documents\Visual Studio 2012\Projects\everyfilenew\everyfilenew\bin\Debug"; string matchedFiles = Directory.GetFiles(baseFolder, "*" +textBox4.Text + "*.txt", SearchOption.AllDirectories); StreamReader rd = new StreamReader(matchedFiles[0],true); string tbx1 = rd.ReadLine(); while (tbx1 != null) { if (tbx1 == textBox4.Text) { MessageBox.Show("Login Success full"); break; } else { MessageBox.Show("Login Not Success full"); } tbx1 = rd.ReadLine(); } rd.Close();