C# - Read Text From Txt File

C# - How To Read Text From Txt File And Display It Into RichTextBox Using C#


In This C#  Tutorial We Will See How To Read Text From Text File And Show It In RichTextBox In CSharp Programming Language .


Project Source Code:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;

namespace WindowsFormsApplication1
{
    public partial class Read_Text_From_txt_File : Form
    {
        public Read_Text_From_txt_File()
        {
            InitializeComponent();
        }

        private void BTN_READ_Click(object sender, EventArgs e)
        {
            TextReader reader = new StreamReader(@"C:\folder\Text.txt");

            richTextBox1.Text = reader.ReadToEnd();

            reader.Close();
        }
    }
}


///////////////OUTPUT:

c# read text from txt file




Share this

Related Posts

Previous
Next Post »

1 comments:

comments
28 octobre 2016 à 22:15 delete

Excellent post! I must thank you for this informative read.i was pleasantly surprised when i read your blog - is good. I feel a lot more people need to read this, very good info! I'd get a kick out of the chance to thank you for the endeavors you have carefully recorded this blog. I truly would like to see a similar high-review blog entries from you later on also.

Reviews of essay writing service

Reply
avatar