EaseFilter Demo Project
ProcessShareEncryptedFileForm.cs
Go to the documentation of this file.
1 //
3 // (C) Copyright 2012 EaseFilter Technologies Inc.
4 // All Rights Reserved
5 //
6 // This software is part of a licensed software product and may
7 // only be used or copied in accordance with the terms of that license.
8 //
10 
11 using System;
12 using System.Collections.Generic;
13 using System.ComponentModel;
14 using System.Data;
15 using System.Drawing;
16 using System.Linq;
17 using System.Text;
18 using System.Windows.Forms;
19 
21 
22 namespace FileProtector
23 {
24  public partial class ProcessShareEncryptedFileForm : Form
25  {
27  {
28  InitializeComponent();
29  }
30 
31  private void button_Start_Click(object sender, EventArgs e)
32  {
33  string lastError = string.Empty;
34 
35  if (!EncryptionHandler.ConvertFileToFilterDriverAwareEncryptFile(textBox_FileName.Text, textBox_PassPhrase.Text, out lastError))
36  {
37  MessageBoxHelper.PrepToCenterMessageBoxOnForm(this);
38  MessageBox.Show("Process share encrypted file failed with error:" + lastError, "Process share encrypted file", MessageBoxButtons.OK, MessageBoxIcon.Error);
39 
40  return;
41  }
42  else
43  {
44  MessageBoxHelper.PrepToCenterMessageBoxOnForm(this);
45  MessageBox.Show("Process share encrypted file succeeded.", "Process share encrypted file", MessageBoxButtons.OK, MessageBoxIcon.Information);
46  }
47 
48  }
49 
50  private void checkBox_DisplayPassword_CheckedChanged(object sender, EventArgs e)
51  {
52  if (checkBox_DisplayPassword.Checked)
53  {
54  textBox_PassPhrase.UseSystemPasswordChar = false;
55  }
56  else
57  {
58  textBox_PassPhrase.UseSystemPasswordChar = true;
59  }
60  }
61 
62  private void button_OpenFile_Click(object sender, EventArgs e)
63  {
64  OpenFileDialog openFileDialog = new OpenFileDialog();
65 
66  if (openFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
67  {
68  textBox_FileName.Text = openFileDialog.FileName;
69  }
70  }
71 
72 
73  }
74 }
static bool ConvertFileToFilterDriverAwareEncryptFile(string fileName, string passPhrase, out string lastError)
Process the encrypted file's embedded access policy, remove embedded information, add AESTagData to e...

Social Network


Services Overview

Architect, implement and test file system filter drivers for a wide range of functionality. We can offer several levels of assistance to meet your specific.

Contact Us

You are welcome to contact us for salse or partnership.

Sales: sales@easefilter.com
Support: support@easefilter.com
Info: info@easefilter.com