Csharp Ninja

Csharp Ninja

  • NA
  • 97
  • 178.5k

Load from .txt to textboxes

Apr 11 2012 9:54 AM


As you see, I have 3 textbox in my form. and I have a .txt file on desktop.



How can I Load this .txt file with button1 to textboxes. I want to textbox1 get line1 from txt file, textbox2 gets line2 from txt file, textbox3 gets line3 from txt file. How can I do that? What code should I write in button1 click event.



I think I need some OpenFileDialog And StreamReader codes. but I can't do it. Help me please.

Thanks



Answers (6)