11
Reply

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

Feroz Khan

Feroz Khan

8 years ago
530
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)