//for save to file if (dlgSave.ShowDialog() == DialogResult.OK) { //create the new file using the name of save dialog box FileStream fleProduction = new FileStream(dlgSave.FileName, FileMode.Create, FileAccess.Write, FileShare.Write); BinaryWriter bnrProduction = new BinaryWriter(fleProduction); //write each value in the file bnrProduction.Write(textBox1.Text); bnrProduction.Write(label1.Text); } //for load file private void openToolStripMenuItem_Click(object sender, EventArgs e) { if (dlgOpen.ShowDialog() == DialogResult.OK) { FileStream fleProduction = new FileStream(this.dlgOpen.FileName, FileMode.Open, FileAccess.Read, FileShare.Read); BinaryReader bnrProduction = new BinaryReader(fleProduction); textBox1.Text = bnrProduction.ReadString(); label1.Text = bnrProduction.ReadString(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)