title: how to use open file dialog?
body: <p>i am trying to write a code to encrypt text using public key and decrypt using private key and passphrase.</p>
  
  <p>I am not very good with programming language because i'm not a programming student. But for my mini-project, i need to write some program about encryption.</p>
  
  <p>For the below code uses a text file from my c drive to encode using the public key.
  But i want to use openfiledialog to choose the file instead of directing it manually(not really practical)</p>
  
  <p>Really appreciate if anyone can help me edit the codes.
  P.S. i don't really know how to apply openfiledialog to my code. i keep getting errors when i use informations from youtubes and google.</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.ComponentModel;
  using System.Data;
  using System.Drawing;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using System.Windows.Forms;
  using System.IO;
  using DidiSoft.Pgp;
  
  namespace TEST2
  {
      public partial class Form1 : Form
      {
          PGPLib pgp = new PGPLib();
          public Form1()
          {
              InitializeComponent();
          }
  
          private void encryptButton_Click(object sender, EventArgs e)
          {
              string testingstring = pgp.EncryptString(testTextBox.Text, new FileInfo(@"c:\TCkeyPublic.txt"));
              encryptedtextTextBox.Text = testingstring;
          }
  
          private void decryptButton_Click(object sender, EventArgs e)
          {
              try
              {
                  String plainString = pgp.DecryptString(encryptedtextTextBox.Text,
                  new FileInfo(@"c:\TCkeyPrivate.txt"), passphraseTextBox.Text);
                  decryptedtextTextBox.Text = plainString;
                  encryptedtextTextBox.Text = "";
                  passphraseTextBox.Text = "";
              }
              catch
              {
                  MessageBox.Show("ERROR! Please check passphrase and do not attempt to edit cipher text");
              }
          }
  
          private void passphraseTextBox_TextChanged(object sender, EventArgs e)
          {
  
          }
  
          private void Form1_Load(object sender, EventArgs e)
          {
  
          }
      }
  }
  </code></pre>