コード例 #1
0
ファイル: Form1.cs プロジェクト: tassi-yuzukko/BinComp
		/// <summary>
		/// ファイルごとのバイナリ比較処理
		/// </summary>
		/// <param name="fileName1"></param>
		/// <param name="fileName2"></param>
		private void binCompFile(string file_name1, string file_name2, XeditCsv xedit_csv)
		{
			BinaryComp binComp = new BinaryComp();
			BINCOMP_RET ret = BINCOMP_RET.EXCEPTION_ERR;

			// バイナリ比較
			binComp.SetFilePath(file_name1, file_name2);
			ret = binComp.Compare();

			// 結果をテキストに出力
			textBox4.AppendText("[比較ファイル:" + Path.GetFileName(file_name1) + " , " + Path.GetFileName(file_name2) + "]\n");
			textBox4.AppendText("[比較結果: " + binComp.GetCompRetStr(ret) + "]\n");

			// 異なる場合は結果をテキストで表示
			for (int i = 0; i < binComp.GetListDifAdrSize(); i++)
			{
				int adr = 0;
				byte val1 = 0, val2 = 0;

				if (binComp.GetDifInfo(i, ref adr, ref val1, ref val2) == false)
				{
					Debug.WriteLine(i.ToString() + "失敗");
					continue;
				}

				textBox4.AppendText("0x" + adr.ToString("X8") + ":    " + val1.ToString("X02") + "    " + val2.ToString("X02"));

				// CSV読込み時
				if (xedit_csv.IsXeditCsvRead == true)
				{
				}

				textBox4.AppendText("\n");
			}

			// 表示終了
			textBox4.AppendText("\n");
		}
コード例 #2
0
ファイル: Form1.cs プロジェクト: tassi-yuzukko/BinComp
		/// <summary>
		/// 実行ボタン
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		private void button_exe_Click(object sender, EventArgs e)
		{
			XeditCsv xedit_csv = new XeditCsv(CSV_TYPE.COMMA);

			// CSV読込み
			if((radioButton1.Checked == true) && (textBox3.TextLength != 0))
			{
				if (xedit_csv.ReadXeditCsv(textBox3.Text) == false)
				{
					Debug.WriteLine("CSV読込み失敗"+textBox3.Text);
				}
			}

			// ファイルモード
			if (radioButton1.Checked == true)
			{
				// 比較処理
				binCompFile(textBox1.Text, textBox2.Text, xedit_csv);
			}
			// フォルダモード
			else if (radioButton2.Checked == true)
			{
				// 比較処理
			}
		}