From 2133ee5aee9dd6cf75e6d4487b3c45d606f7785a Mon Sep 17 00:00:00 2001
From: editor <@51Aspx.com>
Date: Wed, 19 Jun 2024 18:21:40 +0800
Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
51Aspx源码必读.txt | 57 ++++++++++++++++++++++++++++++++++++++++++
AFileCompare.cs | 15 +++++++++++
CRCCompare.cs | 15 +++++++++++
FileCompare.csproj | 14 +++++++++++
FileSizeCompare.cs | 15 +++++++++++
FileSizeCompare2.cs | 15 +++++++++++
HashCompare.cs | 15 +++++++++++
MD5Compare.cs | 15 +++++++++++
Program.cs | 15 +++++++++++
9 files changed, 176 insertions(+)
create mode 100644 51Aspx源码必读.txt
create mode 100644 AFileCompare.cs
create mode 100644 CRCCompare.cs
create mode 100644 FileCompare.csproj
create mode 100644 FileSizeCompare.cs
create mode 100644 FileSizeCompare2.cs
create mode 100644 HashCompare.cs
create mode 100644 MD5Compare.cs
create mode 100644 Program.cs
diff --git a/51Aspx源码必读.txt b/51Aspx源码必读.txt
new file mode 100644
index 0000000..1f1dbe6
--- /dev/null
+++ b/51Aspx源码必读.txt
@@ -0,0 +1,57 @@
+三种文件比较案例
+
+
+ 一、源码描述
+
+
+ 三种文件比较案例
+
+
+ 环境:VS2022
+
+
+
+
+
+ 二、功能介绍
+
+
+ 提供了三种文件比较方式,具体下载代码来看。
+
+
+ 运行时,填写完待比较文件地址即可。
+
+
+
+
+
+ 三、注意事项
+
+
+ ctrl+F5运行即可。
+
+
+
+
+
+
+作者: coderbest
+
+如需获得该源码的视频、更新等更多资料请访问: https://www.51aspx.com/Code/CompareCases
+------------------------------------------------------------------------------------------------
+
+ 源码服务专家
+ 官网: https://www.51aspx.com
+ 讨论圈: https://club.51aspx.com/
+
+平台声明:
+
+1.51Aspx平台上提供下载的资源为免费、共享、商业三类源码,其中免费和共享源码仅供个人学习和研究使用,商业源码请在相应的授权许可条件下使用;
+2.51Aspx平台对提供下载的软件及其它资源不拥有任何权利,其版权归属源码合法拥有者所有;
+3.著作权人发现本网站载有侵害其合法权益的内容或作品,请与我们联系( 登录官网与客服反馈或发送邮件到support@51Aspx.com );
+4.51Aspx平台不保证提供的下载资源的准确性、安全性和完整性;
+
+友情提示:
+ 一般数据库文件默认在 DB_51Aspx 文件夹下
+ 默认账号密码一般均为51Aspx
+ 关于源码使用常见问题及解决方案,请参阅: https://www.51aspx.com/Help
diff --git a/AFileCompare.cs b/AFileCompare.cs
new file mode 100644
index 0000000..3aaa29b
--- /dev/null
+++ b/AFileCompare.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace FileCompare
+{
+ public abstract class AFileCompare
+ {
+ public AFileCompare(string name)
+ {
+ this.Name = name;
+ }
diff --git a/CRCCompare.cs b/CRCCompare.cs
new file mode 100644
index 0000000..a2b159c
--- /dev/null
+++ b/CRCCompare.cs
@@ -0,0 +1,15 @@
+using Force.Crc32;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.Intrinsics.Arm;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace FileCompare
+{
+ public class CRCCompare : AFileCompare
+ {
+ public CRCCompare() : base("CRC")
+ {
+ }
diff --git a/FileCompare.csproj b/FileCompare.csproj
new file mode 100644
index 0000000..49af771
--- /dev/null
+++ b/FileCompare.csproj
@@ -0,0 +1,14 @@
+
+
+
+ Exe
+ net7.0
+ enable
+ enable
+
+
+
+
+
+
+
diff --git a/FileSizeCompare.cs b/FileSizeCompare.cs
new file mode 100644
index 0000000..fb79ee7
--- /dev/null
+++ b/FileSizeCompare.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace FileCompare
+{
+ public class FileSizeCompare : AFileCompare
+ {
+ public FileSizeCompare() : base("FileSize_4096")
+ {
+ }
+
+ public override bool CompareCore(string file1, string file2)
diff --git a/FileSizeCompare2.cs b/FileSizeCompare2.cs
new file mode 100644
index 0000000..3b9b60d
--- /dev/null
+++ b/FileSizeCompare2.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace FileCompare
+{
+ public class FileSizeCompare2 : AFileCompare
+ {
+ public FileSizeCompare2() : base("FileSize_4096_Span")
+ {
+ }
+
+ public override bool CompareCore(string file1, string file2)
diff --git a/HashCompare.cs b/HashCompare.cs
new file mode 100644
index 0000000..9a2b4e6
--- /dev/null
+++ b/HashCompare.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Security.Cryptography;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace FileCompare
+{
+ public class HashCompare : AFileCompare
+ {
+ public HashCompare() : base("Hash256")
+ {
+ }
diff --git a/MD5Compare.cs b/MD5Compare.cs
new file mode 100644
index 0000000..1c7d68e
--- /dev/null
+++ b/MD5Compare.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Security.Cryptography;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace FileCompare
+{
+ public class MD5Compare : AFileCompare
+ {
+ public MD5Compare() : base("MD5")
+ {
+ }
+
diff --git a/Program.cs b/Program.cs
new file mode 100644
index 0000000..65bbe82
--- /dev/null
+++ b/Program.cs
@@ -0,0 +1,15 @@
+using System.ComponentModel;
+using System.Data;
+using System.Net.Http.Headers;
+
+namespace FileCompare
+{
+ internal class Program
+ {
+ static void Main(string[] args)
+ {
+ var files = new List<(string name, string source, string target)>()
+ {
+ ("log",@"C:\Users\coder\Desktop\Logs_20240103.txt",@"C:\Users\coder\Desktop\Logs_20240103 - 副本.txt")
+ };
+ var list = new List();