Read file private void Readbtn_click (object sender, EventArgs e) {try {i F (Pathtxt.text = = "") {MessageBox.Show ("Please enter file address"); Return } Readtxt.text = File.readalltext (Pathtxt.text, Encoding.default);//do not need to escape the "\" in the address} catch (Exception ex) {MessageBox.Show ("File address Error"); }}//write file private void Writebtn_click (object sender, EventArgs e) { try {if (Pathtxt.text = = "") {MessageBox.Show ("Please enter file Address "); Return } file.writealltext (Pathtxt.text, Writetxt.text); MessageBox.Show ("Success"); } catch (Exception ex) {MessageBox.Show ("File address Error"); }}//Read folder path private void Folderbtn_click (object sender, EventArgs e) {if (Folderbrowserdialog1.showdialog () = = DialogResult.OK) {foldertxt.text = Folderbrowserdialog1.selectedpath; }}//read file path private void Filebtn_click (object sender, EventArgs e) {O Penfiledialog op = new OpenFileDialog (); Op. Filter = "Text files (*.txt) |*.txt| All Files (*. *) |*.* "; if (Op. ShowDialog () = = DialogResult.OK) {pathtxt.text = Op. FileName; } }