Ethernal_Five

C# - Read File into Textbox

Nov 18th, 2011
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.42 KB | None | 0 0
  1.         private void ReadFile(string filename)
  2.         {
  3.             int counter = 0;
  4.             string line;
  5.             System.IO.StreamReader file =
  6.                new System.IO.StreamReader(filename);
  7.             while ((line = file.ReadLine()) != null)
  8.             {
  9.                 filetxt.AppendText(line + Environment.NewLine);
  10.                 counter++;
  11.             }
  12.  
  13.             file.Close();
  14.         }
  15.  
Advertisement
Add Comment
Please, Sign In to add comment