Ejemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            //try
            //{
            FileInfo f = new FileInfo(txtFile.Text);

            switch (f.Extension)
            {
            case ".xed":
                XedDecrypt xd = new XedDecrypt();
                xd.Decrypt(txtFile.Text, txtName.Text);
                break;

            case ".txt":
                XedEncrypt xe = new XedEncrypt();
                xe.Encrypt(txtFile.Text, f.DirectoryName, txtName.Text);
                break;

            default:
                MessageBox.Show("Error: Invalid File Type");
                break;
            }
            //}
            //catch
            //{
            //    MessageBox.Show("Error 2: Invalid File Type");
            //}
        }
Ejemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            //try
            //{
                FileInfo f = new FileInfo(txtFile.Text);

                switch(f.Extension)
                {
                    case ".xed":
                        XedDecrypt xd = new XedDecrypt();
                        xd.Decrypt(txtFile.Text,txtName.Text);
                        break;
                    case ".txt":
                        XedEncrypt xe = new XedEncrypt();
                        xe.Encrypt(txtFile.Text, f.DirectoryName,txtName.Text);
                        break;
                    default:
                        MessageBox.Show("Error: Invalid File Type");
                        break;
                }
            //}
            //catch
            //{
            //    MessageBox.Show("Error 2: Invalid File Type");
            //}
        }