C# 文件比较差异
来源:互联网 发布:淘宝代理流程 编辑:程序博客网 时间:2024/04/29 05:33
参考:https://www.cnblogs.com/vaevvaev/p/7115721.html
这里我就比较2个文件 使用了fc命令。
2个文件路径如下 path1,path2
static void Main(string[] args) { string path1 = @"C:\Users\Tyler\Desktop\1.txt"; string path2 = @"C:\Users\Tyler\Desktop\2.txt"; string result = RunCmd("FC "+path1+" "+path2); Console.WriteLine(result); Console.ReadLine(); } public static string RunCmd(string cmd) { Process proc = new Process(); proc.StartInfo.CreateNoWindow = true; proc.StartInfo.FileName = "cmd.exe"; proc.StartInfo.UseShellExecute = false; proc.StartInfo.RedirectStandardError = true; proc.StartInfo.RedirectStandardInput = true; proc.StartInfo.RedirectStandardOutput = true; proc.Start(); proc.StandardInput.WriteLine(cmd); proc.StandardInput.WriteLine("exit"); string outStr = proc.StandardOutput.ReadToEnd(); proc.Close(); return outStr; }
1.txt
2.txt
比较结果:
阅读全文
0 0
- C# 文件比较差异
- cmp指令:比较文件差异
- 文件差异比较工具 Diffuse
- C#中两课树比较差异的粗糙方法
- c#比较两个数组的差异
- 比较两个文件差异的软件 WinMerge
- emacs中比较文件差异ediff
- windows下比较文件差异fc
- linux比较两目录的差异文件
- 快速比较两个TXT文件的差异
- python比较两个文件的差异
- 快速比较两个TXT文件的差异
- webstorm 比较两个文件差异的方法
- diff 比较两个文件的差异
- shell diff 比较两个文件的差异
- diff比较两个文件之间的差异
- C# 文件哈希码比较
- WinMerge 比较文件夹与文件夹之间的文件差异
- jsp编码问题
- 记录下安装ES过程中遇到的错误及解决
- 永远也记不住的linux命令
- Python 文件操作大全
- python线程、锁、死锁以及生产者消费者模式
- C# 文件比较差异
- 12月——细节知识累积
- LSTM学习内容 12.13更新
- Jsvc守护进程
- Android流式布局FlowLayout,一款针对Tag的布局
- 那些容易被忽视但又非常重要的安全知识
- 编译gost2.5版本
- 微服务Spring Cloud学习重点整理
- 101. Symmetric Tree