Example #1
0
        private void btnUpdateCertificate_Click(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.Filter = "Certificate Files|*.*";
            openFileDialog.Title  = "Select a Certificate File";

            if (openFileDialog.ShowDialog() == DialogResult.OK)
            {
                tbCertificateFilePath.Text = openFileDialog.FileName;
                Request(
                    delegate { },
                    delegate {
                    if (!mPenCommV2.IsSupportEncryption)
                    {
                        MessageBox.Show("The pen does not support secure communication.");
                    }

                    if (!mPenCommV2.ReqUpdateCertificate(openFileDialog.FileName))
                    {
                        MessageBox.Show("Certificate transfer failed (Please check the certificate file)");
                    }
                }
                    );
            }
        }