资源简介
实现C#加密各种文件 和解密加密后的文件 完整工程 直接可以编译运行

代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Threading;
using System.Security.Cryptography;
using Microsoft.Win32;
namespace ProtectFile
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
CheckForIllegalCrossThreadCalls = false;
}
private void Form1_Load(object sender EventArgs e)
{
FileMenu(Application.ExecutablePath + “0“ Application.ExecutablePath);
string[] str = Environment.GetCommandLineArgs();
try
{
string strFile = ““;
for (int i = 2; i < str.Length; i++)
strFile += str[i];
FileInfo FInfo = new FileInfo(strFile);
if (FInfo.Extension.ToLower() == “.mr“)
{
textBox1.Text = strFile;
button2.Enabled = false;
button3.Enabled = true;
}
}
catch { }
}
//选择加密、解密文件
private void button1_Click(object sender EventArgs e)
{
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
textBox1.Text = openFileDialog1.FileName;
FileInfo FInfo = new FileInfo(textBox1.Text);
if (FInfo.Extension.ToLower() == “.mr“)
{
button2.Enabled = false;
button3.Enabled = true;
}
else
{
button2.Enabled = true;
button3.Enabled = false;
}
}
}
//加密
private void button2_Click(object sender EventArgs e)
{
if (textBox1.Text != ““)
{
if (textBox2.Text.Length < 6)
MessageBox.Show(“密码不能小于6位!“ “警告“ MessageBoxButtons.OK MessageBoxIcon.Warning);
else
{
EDncrypt myEDncrypt = new EDncrypt(textBox1.Text textBox2.Text progressBar1);
myEDncrypt.StartEncrypt();
progressBar1.Value = 0;
}
}
}
//解密
private void button3_Click(object sender EventArgs e)
{
if (textBox1.Text != ““)
{
if (textBox2.Text.Length < 6)
MessageBox.Show(“密码不能小于6位!“ “警告“ MessageBoxButtons.OK MessageBoxIcon.Warning);
else
{
EDncrypt myEDncrypt = new EDncrypt(textBox1.Text textBox2.Text progressBar1);
myEDncrypt.StartDncrypt();
progressBar1.Value = 0;
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 10795 2008-12-16 09:10 文件加密\Backup\ProtectFile\Form1.cs
文件 8291 2008-12-12 13:18 文件加密\Backup\ProtectFile\Form1.Designer.cs
文件 6017 2008-12-12 13:18 文件加密\Backup\ProtectFile\Form1.resx
文件 492 2008-12-11 14:05 文件加密\Backup\ProtectFile\Program.cs
文件 1376 2008-12-11 14:06 文件加密\Backup\ProtectFile\Properties\AssemblyInfo.cs
文件 2872 2008-12-11 14:05 文件加密\Backup\ProtectFile\Properties\Resources.Designer.cs
文件 5612 2008-12-11 14:05 文件加密\Backup\ProtectFile\Properties\Resources.resx
文件 1096 2008-12-11 14:05 文件加密\Backup\ProtectFile\Properties\Settings.Designer.cs
文件 249 2008-12-11 14:05 文件加密\Backup\ProtectFile\Properties\Settings.settings
文件 3888 2008-12-12 13:04 文件加密\Backup\ProtectFile\ProtectFile.csproj
文件 766 2008-12-12 13:04 文件加密\Backup\ProtectFile\加密.ico
文件 923 2008-12-11 14:05 文件加密\Backup\ProtectFile.sln
..A..H. 20480 2009-01-03 14:34 文件加密\Backup\ProtectFile.suo
文件 16384 2017-06-24 14:15 文件加密\ProtectFile\bin\Debug\ProtectFile.exe
文件 38400 2017-06-24 14:15 文件加密\ProtectFile\bin\Debug\ProtectFile.pdb
文件 11608 2017-11-05 11:27 文件加密\ProtectFile\bin\Debug\ProtectFile.vshost.exe
文件 490 2012-06-06 02:06 文件加密\ProtectFile\bin\Debug\ProtectFile.vshost.exe.manifest
文件 766 2008-12-12 13:03 文件加密\ProtectFile\bin\Debug\加密.ico
文件 10795 2008-12-16 09:10 文件加密\ProtectFile\Form1.cs
文件 8291 2008-12-12 13:18 文件加密\ProtectFile\Form1.Designer.cs
文件 6017 2008-12-12 13:18 文件加密\ProtectFile\Form1.resx
文件 1229 2017-06-30 12:45 文件加密\ProtectFile\obj\Debug\DesignTimeResolveAssemblyReferences.cache
文件 6660 2017-06-24 14:15 文件加密\ProtectFile\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
文件 2135 2017-11-05 11:27 文件加密\ProtectFile\obj\Debug\ProtectFile.csproj.FileListAbsolute.txt
文件 902 2017-06-24 14:15 文件加密\ProtectFile\obj\Debug\ProtectFile.csproj.GenerateResource.Cache
文件 16384 2017-06-24 14:15 文件加密\ProtectFile\obj\Debug\ProtectFile.exe
文件 180 2017-06-24 14:15 文件加密\ProtectFile\obj\Debug\ProtectFile.Form1.resources
文件 38400 2017-06-24 14:15 文件加密\ProtectFile\obj\Debug\ProtectFile.pdb
文件 180 2017-06-24 14:15 文件加密\ProtectFile\obj\Debug\ProtectFile.Properties.Resources.resources
文件 4608 2017-06-24 14:15 文件加密\ProtectFile\obj\Debug\TempPE\Properties.Resources.Designer.cs.dll
............此处省略31个文件信息
相关资源
- C#解析HL7消息的库135797
- C# OCR数字识别实例,采用TessnetOcr,对
- 考试管理系统 - C#源码
- asp.net C#购物车源代码
- C#实时网络流量监听源码
- C#百度地图源码
- Visual C#.2010从入门到精通配套源程序
- C# 软件版本更新
- C#屏幕软键盘源码,可以自己定制界面
- 智慧城市 智能家居 C# 源代码
- c#获取mobile手机的IMEI和IMSI
- C#实现简单QQ聊天程序
- 操作系统 模拟的 欢迎下载 C#版
- C#写的计算机性能监控程序
- 用C#实现邮件发送,有点类似于outlo
- MVC model层代码生成器 C#
- c#小型图书销售系统
- C# Socket Server Client 通讯应用 完整的服
- c# winform 自动登录 百度账户 源代码
- C#编写的16进制计算器
- C#TCP通信协议
- C# 数据表(Dataset)操作 合并 查询一
- C#语音识别系统speechsdk51,SpeechSDK51L
- 数据库备份还原工具1.0 C# 源码
-
[免费]xm
lDocument 节点遍历C# - EQ2008LEDc#开发实例
- DirectX.Capturec# winform 操作摄像头录像附
- c# 实现的最大最小距离方法对鸢尾花
- C#版保龄球记分代码
- C#自定义控件
评论
共有 条评论