資源簡介
資源包含C#源碼,和已經編譯的exe
1、選擇dat文件所在目錄
2、掃描文件
3、軟件自動解密圖片并保存到目錄下

代碼片段和文件信息
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;
namespace?datDecrypt
{
????public?partial?class?Form1?:?Form
????{
????????public?Form1()
????????{
????????????InitializeComponent();
????????????Control.CheckForIllegalCrossThreadCalls?=?false;
????????}
????????private?void?button1_Click(object?sender?EventArgs?e)
????????{
????????????string?path?=?textBox1.Text;
????????????if?(path?==?““)?selectfile();
????????????path?=?textBox1.Text;
????????????if?(!Directory.Exists(path))
????????????{
????????????????MessageBox.Show(“您選擇的文件夾不存在“);
????????????????return;
????????????}
????????????string[]?filepath?=?Directory.GetFiles(path?“*.dat“?SearchOption.TopDirectoryOnly);
????????????if?(filepath.Length<1)
????????????{
????????????????MessageBox.Show(“該文件夾內未找到dat圖片文件“);
????????????????return;
????????????}
????????????listView1.Items.Clear();
????????????for?(var?i?=?0;?i?????????????{
????????????????ListViewItem?item?=?new?ListViewItem((i+1).ToString());????????????????
????????????????item.SubItems.Add(filepath[i]);
????????????????item.SubItems.Add(““);
????????????????item.SubItems.Add(““);
????????????????listView1.Items.Add(item);
????????????}
????????}
????????private?void?textBox1_DoubleClick(object?sender?EventArgs?e)
????????{
????????????selectfile();
????????}
????????private?void?selectfile()
????????{
????????????FolderBrowserDialog?p?=?new?FolderBrowserDialog();
????????????if?(p.ShowDialog()?==?DialogResult.OK)
????????????{
????????????????if?(string.IsNullOrEmpty(p.SelectedPath))?return;
????????????????textBox1.Text?=?p.SelectedPath;?????????????
????????????}
????????}
????????private?void?button2_Click(object?sender?EventArgs?e)
????????{
????????????Task?t?=?new?Task(datthread);
????????????t.Start();????????????
????????}
????????private?void?datthread()
????????{
????????????button1.Enabled?=?false;
????????????button2.Enabled?=?false;
????????????int?i?=?listView1.Items.Count;
????????????string?imgpathspath;
????????????for?(var?a?=?0;?a?????????????{
????????????????if?(!listView1.Items[a].Checked)?continue;
????????????????listView1.Items[a].SubItems[3].Text?=?“正在處理“;
????????????????imgpath?=?listView1.Items[a].SubItems[1].Text;
????????????????spath?=?Path.GetDirectoryName(imgpath)?+?“\\“?+?Path.GetFileNameWithoutExtension(imgpath)?+?“.jpg“;
????????????????int?type;
????????????????byte[]?bin?=?Decryptdat(imgpath?out?type);
????????????????if?(type?==?0)
????????????????{
????????????????????listView1.Items[a].SubItems[3].Text?=?“失敗“;
????????????????????continue;
????????????????}
????????????????string?suffix?=?type?==?1???“jpg“?:?“png“;
????????????????File.WriteAllBytes(spath?bin);
????????????????lis
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????8011??2020-09-28?18:20??Form1.Designer.cs
?????文件???????6022??2020-09-28?18:20??Form1.resx
?????文件????????522??2020-09-28?16:59??Program.cs
?????文件??????12800??2020-09-28?18:32??datDecrypt.exe
?????文件???????4834??2020-09-28?18:27??Form1.cs
-----------?---------??----------?-----??----
????????????????32189????????????????????5
- 上一篇:燕山大學C#實驗報告
- 下一篇:非常好看的winform 自定義日期控件
評論
共有 條評論