亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? main.cs

?? A Generic, Reusable Diff Algorithm in C# 這是一個用C#實現的Diff程序
?? CS
字號:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.IO;
using DifferenceEngine;

namespace DiffCalc
{
	/// <summary>
	/// Summary description for Form1.
	/// </summary>
	public class MainForm : System.Windows.Forms.Form
	{
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.Label label2;
		private System.Windows.Forms.Button cmdCompare;
		private System.Windows.Forms.TextBox txtSource;
		private System.Windows.Forms.Button cmdSource;
		private System.Windows.Forms.Button cmdDestination;
		private System.Windows.Forms.TextBox txtDestination;
		private System.Windows.Forms.Button cmdClose;
		private System.Windows.Forms.CheckBox chkBinary;
		private System.Windows.Forms.GroupBox groupBox1;
		private System.Windows.Forms.RadioButton rbFast;
		private System.Windows.Forms.RadioButton rbMedium;
		private System.Windows.Forms.RadioButton rbSlow;
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;

		private DiffEngineLevel _level;

		public MainForm()
		{
			
			InitializeComponent();

			_level = DiffEngineLevel.FastImperfect; 
		}

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if (components != null) 
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.cmdCompare = new System.Windows.Forms.Button();
			this.label1 = new System.Windows.Forms.Label();
			this.label2 = new System.Windows.Forms.Label();
			this.txtSource = new System.Windows.Forms.TextBox();
			this.cmdSource = new System.Windows.Forms.Button();
			this.cmdDestination = new System.Windows.Forms.Button();
			this.txtDestination = new System.Windows.Forms.TextBox();
			this.cmdClose = new System.Windows.Forms.Button();
			this.chkBinary = new System.Windows.Forms.CheckBox();
			this.groupBox1 = new System.Windows.Forms.GroupBox();
			this.rbFast = new System.Windows.Forms.RadioButton();
			this.rbMedium = new System.Windows.Forms.RadioButton();
			this.rbSlow = new System.Windows.Forms.RadioButton();
			this.groupBox1.SuspendLayout();
			this.SuspendLayout();
			// 
			// cmdCompare
			// 
			this.cmdCompare.Location = new System.Drawing.Point(153, 165);
			this.cmdCompare.Name = "cmdCompare";
			this.cmdCompare.Size = new System.Drawing.Size(61, 20);
			this.cmdCompare.TabIndex = 8;
			this.cmdCompare.Text = "Compare";
			this.cmdCompare.Click += new System.EventHandler(this.cmdCompare_Click);
			// 
			// label1
			// 
			this.label1.Location = new System.Drawing.Point(6, 6);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(45, 15);
			this.label1.TabIndex = 0;
			this.label1.Text = "Source:";
			// 
			// label2
			// 
			this.label2.Location = new System.Drawing.Point(6, 55);
			this.label2.Name = "label2";
			this.label2.Size = new System.Drawing.Size(85, 15);
			this.label2.TabIndex = 3;
			this.label2.Text = "Destination:";
			// 
			// txtSource
			// 
			this.txtSource.Location = new System.Drawing.Point(20, 26);
			this.txtSource.Name = "txtSource";
			this.txtSource.Size = new System.Drawing.Size(233, 20);
			this.txtSource.TabIndex = 1;
			this.txtSource.Text = "";
			// 
			// cmdSource
			// 
			this.cmdSource.Location = new System.Drawing.Point(253, 26);
			this.cmdSource.Name = "cmdSource";
			this.cmdSource.Size = new System.Drawing.Size(28, 20);
			this.cmdSource.TabIndex = 2;
			this.cmdSource.Text = "...";
			this.cmdSource.Click += new System.EventHandler(this.cmdSource_Click);
			// 
			// cmdDestination
			// 
			this.cmdDestination.Location = new System.Drawing.Point(253, 76);
			this.cmdDestination.Name = "cmdDestination";
			this.cmdDestination.Size = new System.Drawing.Size(28, 20);
			this.cmdDestination.TabIndex = 5;
			this.cmdDestination.Text = "...";
			this.cmdDestination.Click += new System.EventHandler(this.cmdDestination_Click);
			// 
			// txtDestination
			// 
			this.txtDestination.Location = new System.Drawing.Point(20, 76);
			this.txtDestination.Name = "txtDestination";
			this.txtDestination.Size = new System.Drawing.Size(233, 20);
			this.txtDestination.TabIndex = 4;
			this.txtDestination.Text = "";
			// 
			// cmdClose
			// 
			this.cmdClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
			this.cmdClose.Location = new System.Drawing.Point(220, 165);
			this.cmdClose.Name = "cmdClose";
			this.cmdClose.Size = new System.Drawing.Size(61, 20);
			this.cmdClose.TabIndex = 9;
			this.cmdClose.Text = "Close";
			this.cmdClose.Click += new System.EventHandler(this.cmdClose_Click);
			// 
			// chkBinary
			// 
			this.chkBinary.Location = new System.Drawing.Point(20, 166);
			this.chkBinary.Name = "chkBinary";
			this.chkBinary.Size = new System.Drawing.Size(83, 16);
			this.chkBinary.TabIndex = 7;
			this.chkBinary.Text = "Binary Diff";
			// 
			// groupBox1
			// 
			this.groupBox1.Controls.Add(this.rbSlow);
			this.groupBox1.Controls.Add(this.rbMedium);
			this.groupBox1.Controls.Add(this.rbFast);
			this.groupBox1.Location = new System.Drawing.Point(7, 103);
			this.groupBox1.Name = "groupBox1";
			this.groupBox1.Size = new System.Drawing.Size(270, 51);
			this.groupBox1.TabIndex = 6;
			this.groupBox1.TabStop = false;
			this.groupBox1.Text = "Diff Level";
			// 
			// rbFast
			// 
			this.rbFast.Checked = true;
			this.rbFast.Location = new System.Drawing.Point(10, 18);
			this.rbFast.Name = "rbFast";
			this.rbFast.Size = new System.Drawing.Size(45, 24);
			this.rbFast.TabIndex = 0;
			this.rbFast.TabStop = true;
			this.rbFast.Text = "Fast";
			// 
			// rbMedium
			// 
			this.rbMedium.Location = new System.Drawing.Point(89, 18);
			this.rbMedium.Name = "rbMedium";
			this.rbMedium.Size = new System.Drawing.Size(69, 24);
			this.rbMedium.TabIndex = 1;
			this.rbMedium.Text = "Medium";
			// 
			// rbSlow
			// 
			this.rbSlow.Location = new System.Drawing.Point(180, 18);
			this.rbSlow.Name = "rbSlow";
			this.rbSlow.Size = new System.Drawing.Size(83, 24);
			this.rbSlow.TabIndex = 2;
			this.rbSlow.Text = "Slow/Best";
			// 
			// Form1
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.CancelButton = this.cmdClose;
			this.ClientSize = new System.Drawing.Size(286, 194);
			this.Controls.Add(this.groupBox1);
			this.Controls.Add(this.chkBinary);
			this.Controls.Add(this.cmdClose);
			this.Controls.Add(this.cmdDestination);
			this.Controls.Add(this.txtDestination);
			this.Controls.Add(this.txtSource);
			this.Controls.Add(this.cmdSource);
			this.Controls.Add(this.label2);
			this.Controls.Add(this.label1);
			this.Controls.Add(this.cmdCompare);
			this.Name = "Form1";
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
			this.Text = "Compare Files";
			this.groupBox1.ResumeLayout(false);
			this.ResumeLayout(false);

		}
		#endregion

		/// <summary>
		/// The main entry point for the application.
		/// </summary>
		[STAThread]
		static void Main() 
		{
			Application.Run(new MainForm());
		}

		private string GetFileName()
		{
			string fname = string.Empty;
			OpenFileDialog dlg = new OpenFileDialog();

			dlg.InitialDirectory = "c:\\" ;
			dlg.Filter = "All files (*.*)|*.*" ;
			dlg.FilterIndex = 1 ;
			dlg.RestoreDirectory = true ;

			if(dlg.ShowDialog() == DialogResult.OK)
			{
				fname = dlg.FileName;
			}
			return fname;
		}

		private void cmdSource_Click(object sender, System.EventArgs e)
		{
			txtSource.Text = GetFileName();
		}

		private void cmdDestination_Click(object sender, System.EventArgs e)
		{
			txtDestination.Text = GetFileName();
		}

		private void cmdClose_Click(object sender, System.EventArgs e)
		{
			this.Close();
		}

		private bool ValidFile(string fname)
		{
			if (fname != string.Empty)
			{
				if (File.Exists(fname))
				{
					return true;
				}
			}
			return false;
		}

		private void TextDiff(string sFile, string dFile)
		{
			this.Cursor = Cursors.WaitCursor;

			DiffList_TextFile sLF = null;
			DiffList_TextFile dLF = null;
			try
			{
				sLF = new DiffList_TextFile(sFile);
				dLF = new DiffList_TextFile(dFile);
			}
			catch (Exception ex)
			{
				this.Cursor = Cursors.Default;
				MessageBox.Show(ex.Message,"File Error");
				return;
			}
			
			try
			{
				double time = 0;
				DiffEngine de = new DiffEngine();
				time = de.ProcessDiff(sLF,dLF,_level);

				ArrayList rep = de.DiffReport();
				Results dlg = new Results(sLF,dLF,rep,time);
				dlg.ShowDialog();
				dlg.Dispose();
			}
			catch (Exception ex)
			{
				this.Cursor = Cursors.Default;
				string tmp = string.Format("{0}{1}{1}***STACK***{1}{2}",
					ex.Message,
					Environment.NewLine,
					ex.StackTrace); 
				MessageBox.Show(tmp,"Compare Error");
				return;
			}
			this.Cursor = Cursors.Default;
		}


		private void BinaryDiff(string sFile, string dFile)
		{
			this.Cursor = Cursors.WaitCursor;

			DiffList_BinaryFile sLF = null;
			DiffList_BinaryFile dLF = null;
			try
			{
				sLF = new DiffList_BinaryFile(sFile);
				dLF = new DiffList_BinaryFile(dFile);
			}
			catch (Exception ex)
			{
				this.Cursor = Cursors.Default;
				MessageBox.Show(ex.Message,"File Error");
				return;
			}
			
			try
			{
				double time = 0;
				DiffEngine de = new DiffEngine();
				time = de.ProcessDiff(sLF,dLF,_level);

				ArrayList rep = de.DiffReport();
				
				BinaryResults dlg = new BinaryResults(rep,time);
				dlg.ShowDialog();
				dlg.Dispose();
								
			}
			catch (Exception ex)
			{
				this.Cursor = Cursors.Default;
				string tmp = string.Format("{0}{1}{1}***STACK***{1}{2}",
					ex.Message,
					Environment.NewLine,
					ex.StackTrace); 
				MessageBox.Show(tmp,"Compare Error");
				return;
			}
			this.Cursor = Cursors.Default;
		}



		private void cmdCompare_Click(object sender, System.EventArgs e)
		{
			string sFile = txtSource.Text.Trim();
			string dFile = txtDestination.Text.Trim();

			if (!ValidFile(sFile))
			{
				MessageBox.Show("Source file name is invalid.","Invalid File");
				txtSource.Focus();
				return;
			}

			if (!ValidFile(dFile))
			{
				MessageBox.Show("Destination file name is invalid.","Invalid File");
				txtDestination.Focus();
				return;
			}
	
			if (rbFast.Checked)
			{
				_level = DiffEngineLevel.FastImperfect; 
			}
			else
			{
				if (rbMedium.Checked)
				{
					_level = DiffEngineLevel.Medium;
				}
				else
				{
					_level = DiffEngineLevel.SlowPerfect; 
				}
			}

			if (chkBinary.Checked)
			{
				BinaryDiff(sFile,dFile);
			}
			else
			{
				TextDiff(sFile,dFile);
			}
			
		}

	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一区二区按摩在线观看| 伊人开心综合网| 色综合久久中文综合久久牛| 成人av高清在线| 国产盗摄视频一区二区三区| 精品一区二区久久| 国产一区二区三区四| 国内精品嫩模私拍在线| 国产成人综合视频| 成人看片黄a免费看在线| 成人美女视频在线观看18| gogo大胆日本视频一区| 91免费精品国自产拍在线不卡| av激情亚洲男人天堂| 在线日韩一区二区| 91精品久久久久久久99蜜桃| 日韩精品最新网址| 国产日韩欧美在线一区| 欧美国产精品劲爆| 一区二区三区四区av| 午夜精品久久久久久久久久| 久久国产精品第一页| 国产精品亚洲专一区二区三区| 国产91精品欧美| 一道本成人在线| 欧美精品日韩一本| 久久免费电影网| 亚洲人成影院在线观看| 日韩av电影免费观看高清完整版| 久久精品国产秦先生| 成人伦理片在线| 欧美精品一二三| 国产精品女主播av| 亚洲va韩国va欧美va| 国产精品一区二区果冻传媒| 在线观看视频91| 2021久久国产精品不只是精品| 亚洲裸体xxx| 国产主播一区二区| 欧美午夜精品一区| 国产日韩欧美精品在线| 天堂久久一区二区三区| 成人少妇影院yyyy| 日韩三级伦理片妻子的秘密按摩| 中文字幕在线不卡一区二区三区| 奇米四色…亚洲| 色狠狠综合天天综合综合| 久久综合国产精品| 亚瑟在线精品视频| 色综合亚洲欧洲| 久久久蜜桃精品| 日韩 欧美一区二区三区| 一本大道久久a久久精二百 | 欧美国产日韩一二三区| 亚洲成年人网站在线观看| 国产凹凸在线观看一区二区| 91精品久久久久久蜜臀| 亚洲一区二区3| 91色porny在线视频| 久久精品视频在线看| 蜜桃视频免费观看一区| 欧美三级电影在线看| 中文字幕久久午夜不卡| 北条麻妃一区二区三区| 精品国产三级a在线观看| 亚洲国产中文字幕在线视频综合| 成人av影院在线| 日本一区二区三区免费乱视频| 男女男精品视频| 欧美一级理论片| 日韩高清中文字幕一区| 56国语精品自产拍在线观看| 亚洲va在线va天堂| 91精品国产综合久久国产大片 | 色先锋久久av资源部| 中日韩av电影| 波多野结衣中文一区| 国产欧美日韩麻豆91| 成人av在线一区二区三区| 欧美高清在线一区二区| 丁香激情综合国产| 国产精品国产三级国产普通话三级| 国产黄人亚洲片| 国产精品久久久久aaaa| 一本色道**综合亚洲精品蜜桃冫| 综合分类小说区另类春色亚洲小说欧美 | 亚洲精品在线观看视频| 久久国产成人午夜av影院| 精品三级在线看| 国产精品一区二区黑丝| 日韩一区在线看| 欧美日本在线播放| 精品一区二区在线观看| 国产日本欧洲亚洲| 91浏览器入口在线观看| 午夜影院久久久| 欧美v日韩v国产v| 成人深夜在线观看| 亚洲一区二区综合| 欧美一级视频精品观看| 国产一区二区三区四区五区入口| 日韩久久一区二区| 717成人午夜免费福利电影| 国产酒店精品激情| 亚洲最新在线观看| 欧美不卡一区二区| 成人a级免费电影| 丝袜a∨在线一区二区三区不卡| 日韩免费电影一区| 91同城在线观看| 免费成人av在线| 亚洲欧美二区三区| 精品国产a毛片| 色噜噜偷拍精品综合在线| 久久国产综合精品| 亚洲人成7777| 久久在线免费观看| 欧美三级视频在线播放| 国产精品亚洲成人| 日本aⅴ亚洲精品中文乱码| 国产精品久久网站| 日韩精品一区二区三区在线播放 | 日韩欧美区一区二| 日本高清不卡aⅴ免费网站| 国产自产视频一区二区三区| 亚洲午夜一区二区三区| 国产精品美女久久久久久久久久久 | 国产日产欧美一区二区视频| 精品视频999| 91在线云播放| 国产精品99久久久久久久女警| 亚洲r级在线视频| 亚洲欧美在线观看| 欧美激情一区二区三区| 精品久久五月天| 日韩区在线观看| 欧美理论在线播放| 欧美午夜片在线观看| 色综合激情五月| 99re成人在线| 一本色道久久加勒比精品| 成人免费视频国产在线观看| 国产一区二区三区蝌蚪| 激情成人综合网| 看片的网站亚洲| 毛片av一区二区三区| 婷婷中文字幕综合| 日韩在线一区二区| 日韩高清在线电影| 美国十次综合导航| 美国av一区二区| 国产又粗又猛又爽又黄91精品| 久久激情综合网| 久久9热精品视频| 国内精品不卡在线| 国产成人免费视频网站 | 亚洲国产wwwccc36天堂| 一区二区三区日韩在线观看| 伊人开心综合网| 偷拍亚洲欧洲综合| 日韩福利电影在线观看| 奇米色一区二区| 国产一区二区不卡老阿姨| 成人午夜在线免费| 91在线一区二区三区| 欧美日本一区二区三区| 91精品国产色综合久久| 精品日本一线二线三线不卡| 欧美tickling网站挠脚心| 久久久综合精品| 亚洲欧洲国产日本综合| 亚洲精品免费在线| 日本在线不卡一区| 国产麻豆精品久久一二三| 不卡视频在线观看| 欧美午夜精品久久久| 日韩欧美国产不卡| 中文幕一区二区三区久久蜜桃| 国产精品你懂的在线| 亚洲国产三级在线| 国内精品写真在线观看| 成人av网在线| 91精品国产乱| 国产精品高清亚洲| 亚洲国产中文字幕在线视频综合| 美女视频黄久久| 99在线精品视频| 日韩一区二区三区四区五区六区 | 91亚洲男人天堂| 91精品欧美综合在线观看最新| 国产亚洲一区二区三区四区| 亚洲美女淫视频| 狠狠色狠狠色综合系列| 91香蕉视频污| 久久久五月婷婷| 另类的小说在线视频另类成人小视频在线 | 日日欢夜夜爽一区| 成人免费视频视频在线观看免费| 欧美日韩不卡一区| 1024成人网|