Hello This is the way to do it
First drag and drop a button and name it as browse and then drag and drop a file dialog box and write this code for reading it
private void button5_Click(object sender, EventArgs e)
{
openFileDialog1.ShowDialog();
}
private void openFileDialog1_FileOk(object sender, CancelEventArgs e)
{
xtxtContent.Text = File.ReadAllText(openFileDialog1.FileName.ToString());
}
For saving it
Drag a Button name it as save and on its click event use this
File.WriteAllText("C:\\demo.txt", textBox1.Text);
Regard's
Raj.Trivedi
"Sharing is Caring"
Please mark as answer if your Query is resolved
Rojasamala, if this helps please login to Mark As Answer. | Alert Moderator