Feroz Khan

Feroz Khan

  • 1.3k
  • 292
  • 85.6k

How can i read txt file and set value in textbox through c#

Jun 9 2016 4:24 PM
Please see below code and picture i want to read data from .txt every after pipe value i want to fix value in text box how can i do this.. with search text box.
 
using (StreamReader sr = new StreamReader(@"C:\filename.txt", true))
{
while ((line = sr.ReadLine()) != null)
{
if(line.Contains(barcode_or_item_txt.Text))
{
Price_txt.Text = line.Substring(8,5);
}
}
}
 

Attachment: Notepad_File.rar

Answers (11)