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); } } }
private void btnencrypt_Click(object sender, RoutedEventArgs e) { Myglobals.message2encrypt = txtdecrypted.Text; RsaFileDemo.LaunchEncryption(); txtencrypted.Text = Myglobals.encrypt; }