private void Button2_Click(object sender, EventArgs e) { string kk; string ee; string mm; OpenFileDialog1.InitialDirectory = "e:\\"; OpenFileDialog1.FileName = "open a file..."; OpenFileDialog1.Filter = "only text files (*.txt)| *.txt"; OpenFileDialog1.ShowDialog(); IO.StreamReader rr = new IO.StreamReader(OpenFileDialog1.FileName); mm = rr.ReadToEnd; rr.Close(); TextBox2.Text = this.bin_word(mm); kk = "11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" + "111111111111111111111111111"; Stopwatch watch = Stopwatch.StartNew(); watch.Start(); ee = this.completedecryption(mm, kk); TextBox3.Text = ee.Substring(0, TextBox1.Text.Length); watch.Stop(); TextBox5.Text = watch.Elapsed.TotalSeconds; }
private void Button1_Click(object sender, EventArgs e) { string f; OpenFileDialog1.InitialDirectory = "e:\\"; OpenFileDialog1.FileName = "open a file..."; OpenFileDialog1.Filter = "only text files (*.txt)| *.txt"; OpenFileDialog1.ShowDialog(); IO.StreamReader r = new IO.StreamReader(OpenFileDialog1.FileName); TextBox1.Text = r.ReadToEnd; r.Close(); // MsgBox(Len(TextBox1.Text)) string key = "11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" + "111111111111111111111111111"; Stopwatch watch = Stopwatch.StartNew(); watch.Start(); f = this.completeencryption(TextBox1.Text, key); watch.Stop(); TextBox4.Text = watch.Elapsed.TotalSeconds; System.IO.StreamWriter objWriter = new System.IO.StreamWriter("e:\\file1.txt", false); objWriter.WriteLine(f); objWriter.Close(); }
private void Prog_In_Timer_Tick(object sender, EventArgs e) { //Inrement by +1 in progressbar #1 (get it started) ProgressBar1.Increment(+1); //Add percent towards the central label Label2.Text = "Loading... " + ProgressBar1.Value.ToString + "%"; IO.StreamReader r = default(IO.StreamReader); //Self-setup and checkup if (ProgressBar1.Value == "1") { if (My.Computer.FileSystem.DirectoryExists("C:\\CoderRevolt\\WebBrowser\\V1")) { //Check if returning user } else { //If user is new, then create core directory folder My.Computer.FileSystem.CreateDirectory("C:\\CoderRevolt\\WebBrowser\\V1"); } } //Make sure History and Bookmarks panels are loaded up for next ProgressCheck @ Value '10' if (ProgressBar1.Value == "5") { Hist.Show(); Hist.Hide(); Bookmarks.Show(); Bookmarks.Hide(); } //Bookmark Self-Check and Setup if (ProgressBar1.Value == "10") { if (My.Computer.FileSystem.FileExists("C:\\CoderRevolt\\WebBrowser\\V1\\Bookmarks.gwbb")) { r = new IO.StreamReader("C:\\CoderRevolt\\WebBrowser\\V1\\Bookmarks.gwbb"); while ((r.Peek() > -1)) { Bookmarks.ListBox1.Items.Add(r.ReadLine); } r.Close(); } else { } if (My.Computer.FileSystem.FileExists("C:\\CoderRevolt\\WebBrowser\\V1\\Bookmarks2.gwbb")) { r = new IO.StreamReader("C:\\CoderRevolt\\WebBrowser\\V1\\Bookmarks2.gwbb"); while ((r.Peek() > -1)) { Bookmarks.ListBox2.Items.Add(r.ReadLine); } r.Close(); } else { } } //History Self-Check and Setup if (ProgressBar1.Value == "20") { if (My.Computer.FileSystem.FileExists("C:\\CoderRevolt\\WebBrowser\\V1\\History1.gwbb")) { r = new IO.StreamReader("C:\\CoderRevolt\\WebBrowser\\V1\\History1.gwbb"); while ((r.Peek() > -1)) { Hist.ListBox1.Items.Add(r.ReadLine); } r.Close(); } else { } if (My.Computer.FileSystem.FileExists("C:\\CoderRevolt\\WebBrowser\\V1\\History2.gwbb")) { r = new IO.StreamReader("C:\\CoderRevolt\\WebBrowser\\V1\\History2.gwbb"); while ((r.Peek() > -1)) { Hist.ListBox2.Items.Add(r.ReadLine); } r.Close(); } else { } } if (ProgressBar1.Value == "100") { Prog_In_Timer.Stop(); this.Hide(); Main.Show(); } }