// Read the private void readBtn_Click (object sender, EventArgs e) {try {if (pathTxt. text = "") {MessageBox. show ("Enter the file address"); return;} readTxt. text = File. readAllText (pathTxt. text, Encoding. default); // do not need to escape "\" in the address} catch (Exception ex) {MessageBox. show ("file address error"); }}// write the private void writeBtn_Click (object sender, EventArgs e) {try {if (pathTxt. text = "") {MessageBox. show ("Enter the File address"); return;} File. writeAllText (pathTxt. text, writeTxt. text); MessageBox. show ("success");} catch (Exception ex) {MessageBox. show ("file address error") ;}}// read the folder path private void folderBtn_Click (object sender, EventArgs e) {if (folderBrowserDialog1.ShowDialog () = DialogResult. OK) {folderTxt. text = folderBrowserDialog1.SelectedPath; }}// read the file path private void fileBtn_Click (object sender, EventArgs e) {OpenFileDialog op = new OpenFileDialog (); op. filter = "Text files (*. txt) | *. txt | All Files (*. *) | *. * "; if (op. showDialog () = DialogResult. OK) {pathTxt. text = op. fileName ;}}