Exemplo n.º 1
0
        public MainWindow()
        {
            InitializeComponent();


            if (File.Exists("./icons/pub.cert"))
            {
                Myglobals.filenamepk = "./icons/pub.cert";
                Myglobals.filenamesk = "./icons/priv.cert";
            }
            else
            {
                try
                {
                    Myglobals.filenamepk = "./icons/pub.cert";
                    Myglobals.filenamesk = "./icons/priv.cert";

                    RsaFileDemo.LaunchEncryption();
                }
                catch
                {
                    MessageBox.Show("When you start the Program for the first time you have to run it as admin");
                    System.Environment.Exit(0);
                }
            }
        }
Exemplo n.º 2
0
 private void btnencrypt_Click(object sender, RoutedEventArgs e)
 {
     Myglobals.message2encrypt = txtdecrypted.Text;
     RsaFileDemo.LaunchEncryption();
     txtencrypted.Text = Myglobals.encrypt;
 }