Beispiel #1
0
        private void button4_Click(object sender, EventArgs e)  //save source file
        {
            SaveFileDialog saveFile = new SaveFileDialog();

            saveFile.Filter           = "All files (*.*)|*.*";
            saveFile.RestoreDirectory = true;
            saveFile.ShowDialog();
            if (saveFile.FileName != "")
            {
                using (FileStream fstream = new FileStream(saveFile.FileName, FileMode.OpenOrCreate))      //@"C:\SomeDir\noname\note.txt"
                {
                    ConvertToBase64 converter = new ConvertToBase64();
                    fstream.Write(converter.Decode(textBox4.Text), 0, converter.Decode(textBox4.Text).Length);
                }
            }
        }
Beispiel #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            ConvertToBase64 converter = new ConvertToBase64();

            textBox2.Text = converter.EncodeString(textBox1.Text);
            textBox3.Text = converter.Decode(textBox2.Text).ToString();
        }