Exemplo n.º 1
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         OpenFileDialog file = new OpenFileDialog();                                     //işlem görecek dosya seçilir
         file.ShowDialog();
         DosyaYolu = file.FileName;
         DosyaAdi  = file.SafeFileName;
         FileReadWrite filerw = new FileReadWrite();
         filerw.ByteOku(DosyaYolu);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Exemplo n.º 2
0
 private void button2_Click(object sender, EventArgs e)
 {
     try
     {
         OpenFileDialog ofd = new OpenFileDialog();                                      //işlem görmüş dosyamı seçiyorum
         ofd.ShowDialog();
         dosyaadi = ofd.SafeFileName;
         string        dosyayolu = ofd.FileName;
         FileReadWrite frw       = new FileReadWrite();
         encrypt = frw.ByteOku(dosyayolu);
         if (dosyaadi == DosyaAdi)
         {
             comboBox2.Enabled = true;
         }
         else if (dosyaadi != DosyaAdi)
         {
             MessageBox.Show("Dosya ismini değiştirdiniz yada farklı bir dosya seçtiniz. İşlem yapamazsınız!");
             comboBox2.Enabled = false;
         }
         else if (dosyaadi == null)
         {
             MessageBox.Show("Dosya seçmediniz.Lütfen işlem yapacağınız dosyayı seçiniz.");
             comboBox2.Enabled = false;
         }
         else if (DosyaYolu != dosyayolu)
         {
             MessageBox.Show("Dosyayı şifrelendiği dizine geri getiriniz!");
             comboBox2.Enabled = false;
         }
         else if (DosyaAdi == null)
         {
             MessageBox.Show("İşlem gerçekleşen dosya bulunamadı.");
             comboBox2.Enabled = false;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }