Exemple #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            //timer1.Start();
            StreamWriter tw = new StreamWriter("C:\\Users\\Matea\\Desktop\\file.txt");
            Stream       myStream;

            for (int i = 0; i < richTextBox2.Lines.Length; i++)
            {
                tw.WriteLine(richTextBox2.Lines[i]);
            }
            tw.Flush();
            tw.Close();
            Zapis.hashing();



            OpenFileDialog ofd = new OpenFileDialog();

            if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                if ((myStream = ofd.OpenFile()) != null)
                {
                    string name     = ofd.FileName;
                    string fileText = File.ReadAllText(name);
                    richTextBox1.Text = fileText;
                }
            }
        }
Exemple #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            num = Convert.ToInt32(textBox2.Text);
            //Stream myStream;
            Generator.generiraj(num);
            Zapis.hashing();
            Stream         zapis;
            OpenFileDialog of = new OpenFileDialog();
            Stream         my;
            OpenFileDialog d = new OpenFileDialog();

            if (of.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                if ((zapis = of.OpenFile()) != null)
                {
                    string name     = of.FileName;
                    string fileText = File.ReadAllText(name);
                    richTextBox2.Text = fileText;
                }
            }


            if (d.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                if ((my = d.OpenFile()) != null)
                {
                    string name     = d.FileName;
                    string fileText = File.ReadAllText(name);
                    richTextBox1.Text = fileText;
                }
            }
        }