C#二进制文件编程实践
生活随笔
收集整理的這篇文章主要介紹了
C#二进制文件编程实践
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
C#讀寫二進制文件
http://www.cnblogs.com/top5/archive/2011/02/07/1949675.html本文要介紹的C#本地讀寫二進制文件,二進制文件指保存在物理磁盤的一個文件。
第一步:讀寫文件轉成流對象。其實就是讀寫文件流 (FileStream對象,在System.IO命名空間中)。File、FileInfo、FileStream這三個類可以將打開文件,并變成文件 流。下面是引用微軟對File、FileInfo、FileStream的介紹
System.IO.File類 提供用于創建、復制、刪除、移動和打開文件的靜態方法,并協助創建 FileStream 對象。
System.IO.FileInfo類 提供創建、復制、刪除、移動和打開文件的實例方法,并且幫助創建 FileStream 對象。無法繼承此類。
System.IO.FileStream類 公開以文件為主的 Stream,既支持同步讀寫操作,也支持異步讀寫操作。
我直接使用 FileStream,他繼承于Stream
第二步:讀寫流。讀寫二進制文件用System.IO.BinaryReader和System.IO.BinaryWriter類;讀寫文本文件用System.IO.TextReader和System.IO.TextWriter類。下面是我的實體 (即要保持到文件的數據)
? /// <summary>
?/// 學生基本信息類
?/// </summary>
?public class Student
?{
? /// <summary>
? /// 學號變量
? /// </summary>
? private String _id;
? /// <summary>
? /// 姓名變量
? /// </summary>
? private String _name;
? /// <summary>
? /// 語文成績變量
? /// </summary>
? private Double _score1;
? /// <summary>
? /// 數學成績變量
? /// </summary>
? private Double _score2;
? /// <summary>
? /// 英語成績變量
? /// </summary>
? private Double _score3;
? /// <summary>
? /// 學號屬性
? /// </summary>
? public String Id
? {
? ?get { return _id; }
? ?set { _id = value; }
? }
? /// <summary>
? /// 姓名屬性
? /// </summary>
? public String Name
? {
? ?get { return _name; }
? ?set { _name = value; }
? }
? /// <summary>
? /// 語文成績屬性
? /// </summary>
? public Double Score1
? {
? ?get { return _score1; }
? ?set { _score1 = value; }
? }
? /// <summary>
? /// 數學成績屬性
? /// </summary>
? public Double Score2
? {
? ?get { return _score2; }
? ?set { _score2 = value; }
? }
? /// <summary>
? /// 英語成績屬性
? /// </summary>
? public Double Score3
? {
? ?get { return _score3; }
? ?set { _score3 = value; }
? }
?}
?下面是我的讀方法,讀取文件中的信息到參數List<Student> stu中 ?
? /// <summary>
? /// 讀取信息方法
? /// </summary>
? /// <returns>讀取是否成功</returns>
? public void ReadInfo(List<Student> stu)
? {
? ?Console.WriteLine("請輸入文件讀取路徑:(鍵入回車為默認路徑)");
? ?String filename = Console.ReadLine();
? ?FileStream fs;
? ?//默認路徑
? ?if (filename == "")
? ?{
? ? fs = new FileStream("student.dll", FileMode.Open);
? ?}
? ?else
? ?{
? ? //如果文件不存在,就提示錯誤
? ? if (!File.Exists(filename))
? ? {
? ? ?Console.WriteLine("\n\t讀取失敗!\n錯誤原因:可能不存在此文件");
? ? ?return;
? ? }
? ? //否則創建文件
? ? fs = new FileStream(filename, FileMode.Open);
? ?}
? ?//使用二進制讀取
? ?BinaryReader br = new BinaryReader(fs);
? ?Console.Write("讀取信息將覆蓋現有的信息,繼續嗎?y/n :");
? ?String command = Console.ReadLine();
? ?if (command == "y" || command == "Y")
? ?{
? ? for (int i = 0; i < stu.Count; i++)
? ? {
? ? ?stu.RemoveAt(i);
? ? }
? ? //從磁盤上讀取信息
? ? try
? ? {
? ? ?while (true)
? ? ?{
? ? ? Student student = new Student();
? ? ? student.Id = br.ReadString();
? ? ? student.Name = br.ReadString();
? ? ? student.Score1 = br.ReadDouble();
? ? ? student.Score2 = br.ReadDouble();
? ? ? student.Score3 = br.ReadDouble();
? ? ? stu.Add(student);
? ? ? student = null;
? ? ?}
? ? }
? ? catch (Exception)
? ? {
? ? ?Console.WriteLine("\n\n讀取結束!");
? ? }
? ?}
? ?br.Close();
? ?fs.Close();
? }
下面是我的寫入方法,寫入參數List<Student> stu中的數據
? /// <summary>
? /// 寫入信息方法
? /// </summary>
? /// <returns>寫入是否成功</returns>
? public void WriteInfo(List<Student> stu)
? {
? ?Console.WriteLine("請輸入文件保存路徑:(鍵入回車為默認路徑)");
? ?FileStream fs;
? ?String filename = Console.ReadLine();
? ?//默認路徑
? ?if (filename == "")
? ?{
? ? fs = new FileStream("student.dll", FileMode.Create);
? ?}
? ?//手動輸入路徑
? ?else
? ?{
? ? //如果文件存在,就提示錯誤
? ? if (File.Exists(filename))
? ? {
? ? ?Console.WriteLine("\n\t保存失敗!\n錯誤原因:可能存在相同文件");
? ? ?return;
? ? }
? ? //否則創建文件
? ? fs = new FileStream(filename, FileMode.Create);
? ?}
? ?//數據保存到磁盤中
? ?BinaryWriter bw = new BinaryWriter(fs);
? ?foreach (Student student in stu)
? ?{
? ? bw.Write((String)student.Id);
? ? bw.Write((String)student.Name);
? ? bw.Write((Double)student.Score1);
? ? bw.Write((Double)student.Score2);
? ? bw.Write((Double)student.Score3);
? ? bw.Flush();
? ?}
? ?bw.Close();
? ?fs.Close();
? ?Console.WriteLine("保存成功!");
? }
========
C#二進制文件比較程序
http://blog.csdn.net/foart/article/details/7031577轉:http://www.cnblogs.com/hbhbice/archive/2010/06/30/1768477.html
下面是CompareFile.cs
[csharp] view plain copy print?
using System; ?
?using System.Collections.Generic; ?
?using System.Text; ?
?using System.IO; ?
?using System.Windows.Forms; ?
?using System.Data; ?
? ?
?namespace CompareFile ?
?{ ?
? ? ?public ?class FileCompare ?
? ? ?{ ?
? ? ? ? ?private FileStream fs1, fs2; ?
? ? ? ? ?private DataTable _DiffTab1,_DiffTab2; ?
? ?
? ? ? ? ?public DataTable DiffTab1 ?
? ? ? ? ?{ ?
? ? ? ? ? ? ?get { ?
? ? ? ? ? ? ? ? ?return _DiffTab1; ?
? ? ? ? ? ? ?} ?
? ? ? ? ?} ?
? ?
? ? ? ? ?public DataTable DiffTab2 ?
? ? ? ? ?{ ?
? ? ? ? ? ? ?get ?
? ? ? ? ? ? ?{ ?
? ? ? ? ? ? ? ? ?return _DiffTab2; ?
? ? ? ? ? ? ?} ?
? ? ? ? ?} ?
? ?
? ? ? ? ?public FileCompare(FileStream fs1, FileStream fs2) ?
? ? ? ? ?{ ?
? ? ? ? ? ? ?this.fs1 = fs1; ?
? ? ? ? ? ? ?this.fs2 = fs2; ?
? ? ? ? ?} ?
? ?
? ? ? ? ?public void CompareAllFile() ?
? ? ? ? ?{ ?
? ? ? ? ? ? ?if (fs1 .Length !=fs2.Length ) ?
? ? ? ? ? ? ?{ ?
? ? ? ? ? ? ? ? ?if (MessageBox.Show("兩文件長度不等\r\n文件1長:" + fs1.Length.ToString() + "\r\n文件2長:" + fs2.Length.ToString() + "\r\n是否繼續比較?", "文件比較結果") == DialogResult.Cancel ) ?
? ? ? ? ? ? ? ? ?{ ?
? ? ? ? ? ? ? ? ? ? ?return; ?
? ? ? ? ? ? ? ? ?} ?
? ? ? ? ? ? ?} ?
? ? ? ? ? ? ?BinaryReader br1 = new BinaryReader (fs1 ); ?
? ? ? ? ? ? ?BinaryReader br2 = new BinaryReader (fs2); ?
? ? ? ? ? ? ?long min = fs1.Length >= fs2.Length ? fs2.Length : fs1.Length; ?
? ? ? ? ? ? ?for (long i = 0; i <min ? ; i++) ?
? ? ? ? ? ? ?{ ?
? ? ? ? ? ? ? ? ?if ( br1 .ReadByte ()!=br2 .ReadByte ()) ?
? ? ? ? ? ? ? ? ?{ ?
? ? ? ? ? ? ? ? ? ? ?if (MessageBox.Show("從0起,第" + (br1.BaseStream.Position - 1).ToString() + "個字節不匹配" + "是否繼續搜尋?", "文件比較",MessageBoxButtons.OKCancel) == DialogResult.OK) ?
? ? ? ? ? ? ? ? ? ? ?{ ?
? ?
? ? ? ? ? ? ? ? ? ? ?} ?
? ? ? ? ? ? ? ? ? ? ?else ??
? ? ? ? ? ? ? ? ? ? ?{ ?
? ? ? ? ? ? ? ? ? ? ? ? ?br1.BaseStream.Seek((br1.BaseStream.Position / 50) * 50, 0); ?
? ? ? ? ? ? ? ? ? ? ? ? ?br2.BaseStream.Seek((br1.BaseStream.Position / 50) * 50, 0); ?
? ? ? ? ? ? ? ? ? ? ? ? ?if (br1 .BaseStream .Length - br1 .BaseStream .Position >50&&br2 .BaseStream .Length - br2 .BaseStream .Position >50) ?
? ? ? ? ? ? ? ? ? ? ? ? ?{ ?
? ? ? ? ? ? ? ? ? ? ? ? ? ? ?_DiffTab1 = new DataTable(); ?
? ? ? ? ? ? ? ? ? ? ? ? ? ? ?_DiffTab2 = new DataTable(); ?
? ? ? ? ? ? ? ? ? ? ? ? ? ? ?DataColumn dc1 = new DataColumn("位置"); ?
? ? ? ? ? ? ? ? ? ? ? ? ? ? ?DataColumn dc2 = new DataColumn("數值"); ?
? ? ? ? ? ? ? ? ? ? ? ? ? ? ?DataColumn dc3 = new DataColumn("位置"); ?
? ? ? ? ? ? ? ? ? ? ? ? ? ? ?DataColumn dc4 = new DataColumn("數值"); ?
? ? ? ? ? ? ? ? ? ? ? ? ? ? ?_DiffTab1.Columns.Add(dc1); ?
? ? ? ? ? ? ? ? ? ? ? ? ? ? ?_DiffTab1.Columns.Add(dc2); ?
? ? ? ? ? ? ? ? ? ? ? ? ? ? ?_DiffTab2.Columns.Add(dc3); ?
? ? ? ? ? ? ? ? ? ? ? ? ? ? ?_DiffTab2.Columns.Add(dc4); ?
? ? ? ? ? ? ? ? ? ? ? ? ? ? ?for (int j = 0; j < 50; j++) ?
? ? ? ? ? ? ? ? ? ? ? ? ? ? ?{ ?
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?DataRow dr1 = _DiffTab1.NewRow(); ?
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?dr1[0] = br1.BaseStream.Position; ?
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?dr1[1] = br1.ReadByte(); ?
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?DiffTab1.Rows.Add(dr1); ?
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?DataRow dr2 = _DiffTab2.NewRow(); ?
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?dr2[0] = br2.BaseStream.Position; ?
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?dr2[1] = br2.ReadByte(); ?
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?DiffTab2.Rows.Add(dr2); ?
? ? ? ? ? ? ? ? ? ? ? ? ? ? ?} ?
? ? ? ? ? ? ? ? ? ? ? ? ?} ?
? ? ? ? ? ? ? ? ? ? ? ? ?return; ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ? ? ? ?} ? ?
? ?
? ? ? ? ? ? ? ? ?} ?
? ? ? ? ? ? ? ? ?if (fs1.Position == min ) ?
? ? ? ? ? ? ? ? ?{ ?
? ? ? ? ? ? ? ? ? ? ?MessageBox.Show("到達兩文件中較小文件的尾部"); ?
? ? ? ? ? ? ? ? ?} ?
? ? ? ? ? ? ?} ? ? ? ? ? ? ? ? ? ??
? ?
? ? ? ? ?} ?
? ? ?} ?
?} ?
Form1.cs
[csharp] view plain copy print?
using System; ?
using System.Collections.Generic; ?
using System.ComponentModel; ?
using System.Data; ?
using System.Drawing; ?
using System.Text; ?
using System.Windows.Forms; ?
using System.IO; ?
??
namespace CompareFile ?
{ ?
? ? public partial class Form1 : Form ?
? ? { ?
? ? ? ? FileStream fs1; ?
? ? ? ? FileStream fs2; ?
??
? ? ? ? public Form1() ?
? ? ? ? { ?
? ? ? ? ? ? InitializeComponent(); ?
? ? ? ? } ?
??
? ? ? ? private void 打開OToolStripMenuItem_Click(object sender, EventArgs e) ?
? ? ? ? { ?
? ? ? ? ? ? if (openFileDialog1 .ShowDialog ()== DialogResult .OK ) ?
? ? ? ? ? ? { ?
? ? ? ? ? ? ? ? fs1 = (FileStream )openFileDialog1.OpenFile(); ?
? ? ? ? ? ? } ?
? ? ? ? } ?
??
? ? ? ? private void 保存SToolStripMenuItem_Click(object sender, EventArgs e) ?
? ? ? ? { ?
? ? ? ? ? ? if (openFileDialog1.ShowDialog ()== DialogResult .OK ) ?
? ? ? ? ? ? { ?
? ? ? ? ? ? ? ? fs2 = (FileStream )openFileDialog1.OpenFile(); ?
? ? ? ? ? ? } ?
? ? ? ? } ?
??
? ? ? ? private void 自定義CToolStripMenuItem_Click(object sender, EventArgs e) ?
? ? ? ? { ?
? ? ? ? ? ? if (fs1 != null && fs2 != null) ?
? ? ? ? ? ? { ?
? ? ? ? ? ? ? ? CompareFile.FileCompare fc = new CompareFile.FileCompare(fs1, fs2); ?
? ? ? ? ? ? ? ? fc.CompareAllFile(); ?
? ? ? ? ? ? ? ? dataGridView1.DataSource = fc.DiffTab1; ?
? ? ? ? ? ? ? ? dataGridView2.DataSource = fc.DiffTab2; ?
? ? ? ? ? ? } ?
? ? ? ? ? ? else ?
? ? ? ? ? ? { ?
? ? ? ? ? ? ? ? MessageBox.Show ("請先將兩個文件打開,然后再進行比較!"); ?
? ? ? ? ? ? } ?
??
? ? ? ? } ?
??
? ? ? ? private void 另存為AToolStripMenuItem_Click(object sender, EventArgs e) ?
? ? ? ? { ?
? ? ? ? ? ? fs1.Close(); ?
? ? ? ? ? ? fs2.Close(); ?
??
? ? ? ? } ? ?
? ? } ?
} ?
Form1.Designer.cs(如果界面方面不清楚,參考以下代碼。)
[csharp] view plain copy print?
namespace CompareFile ?
{ ?
? ? partial class Form1 ?
? ? { ?
? ? ? ? /// <summary> ?
? ? ? ? /// 必需的設計器變量。 ?
? ? ? ? /// </summary> ?
? ? ? ? private System.ComponentModel.IContainer components = null; ?
??
? ? ? ? /// <summary> ?
? ? ? ? /// 清理所有正在使用的資源。 ?
? ? ? ? /// </summary> ?
? ? ? ? /// <param name="disposing">如果應釋放托管資源,為 true;否則為 false。</param> ?
? ? ? ? protected override void Dispose(bool disposing) ?
? ? ? ? { ?
? ? ? ? ? ? if (disposing && (components != null)) ?
? ? ? ? ? ? { ?
? ? ? ? ? ? ? ? components.Dispose(); ?
? ? ? ? ? ? } ?
? ? ? ? ? ? base.Dispose(disposing); ?
? ? ? ? } ?
?
? ? ? ? #region Windows 窗體設計器生成的代碼 ?
??
? ? ? ? /// <summary> ?
? ? ? ? /// 設計器支持所需的方法 - 不要 ?
? ? ? ? /// 使用代碼編輯器修改此方法的內容。 ?
? ? ? ? /// </summary> ?
? ? ? ? private void InitializeComponent() ?
? ? ? ? { ?
? ? ? ? ? ? System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1)); ?
? ? ? ? ? ? this.menuStrip1 = new System.Windows.Forms.MenuStrip(); ?
? ? ? ? ? ? this.文件FToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); ?
? ? ? ? ? ? this.新建NToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); ?
? ? ? ? ? ? this.打開OToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); ?
? ? ? ? ? ? this.保存SToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); ?
? ? ? ? ? ? this.toolStripSeparator = new System.Windows.Forms.ToolStripSeparator(); ?
? ? ? ? ? ? this.另存為AToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); ?
? ? ? ? ? ? this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); ?
? ? ? ? ? ? this.打印PToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); ?
? ? ? ? ? ? this.打印預覽VToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); ?
? ? ? ? ? ? this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); ?
? ? ? ? ? ? this.退出XToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); ?
? ? ? ? ? ? this.編輯EToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); ?
? ? ? ? ? ? this.撤消UToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); ?
? ? ? ? ? ? this.重復RToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); ?
? ? ? ? ? ? this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); ?
? ? ? ? ? ? this.剪切TToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); ?
? ? ? ? ? ? this.復制CToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); ?
? ? ? ? ? ? this.粘貼PToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); ?
? ? ? ? ? ? this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); ?
? ? ? ? ? ? this.全選AToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); ?
? ? ? ? ? ? this.工具TToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); ?
? ? ? ? ? ? this.自定義CToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); ?
? ? ? ? ? ? this.選項OToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); ?
? ? ? ? ? ? this.幫助HToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); ?
? ? ? ? ? ? this.內容CToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); ?
? ? ? ? ? ? this.索引IToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); ?
? ? ? ? ? ? this.搜索SToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); ?
? ? ? ? ? ? this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator(); ?
? ? ? ? ? ? this.關于AToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); ?
? ? ? ? ? ? this.splitContainer1 = new System.Windows.Forms.SplitContainer(); ?
? ? ? ? ? ? this.dataGridView1 = new System.Windows.Forms.DataGridView(); ?
? ? ? ? ? ? this.dataGridView2 = new System.Windows.Forms.DataGridView(); ?
? ? ? ? ? ? this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); ?
? ? ? ? ? ? this.toolStrip1 = new System.Windows.Forms.ToolStrip(); ?
? ? ? ? ? ? this.toolStripButton1 = new System.Windows.Forms.ToolStripButton(); ?
? ? ? ? ? ? this.menuStrip1.SuspendLayout(); ?
? ? ? ? ? ? this.splitContainer1.Panel1.SuspendLayout(); ?
? ? ? ? ? ? this.splitContainer1.Panel2.SuspendLayout(); ?
? ? ? ? ? ? this.splitContainer1.SuspendLayout(); ?
? ? ? ? ? ? ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); ?
? ? ? ? ? ? ((System.ComponentModel.ISupportInitialize)(this.dataGridView2)).BeginInit(); ?
? ? ? ? ? ? this.toolStrip1.SuspendLayout(); ?
? ? ? ? ? ? this.SuspendLayout(); ?
? ? ? ? ? ? // ??
? ? ? ? ? ? // menuStrip1 ?
? ? ? ? ? ? // ??
? ? ? ? ? ? this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { ?
? ? ? ? ? ? this.文件FToolStripMenuItem, ?
? ? ? ? ? ? this.編輯EToolStripMenuItem, ?
? ? ? ? ? ? this.工具TToolStripMenuItem, ?
? ? ? ? ? ? this.幫助HToolStripMenuItem}); ?
? ? ? ? ? ? this.menuStrip1.Location = new System.Drawing.Point(0, 0); ?
? ? ? ? ? ? this.menuStrip1.Name = "menuStrip1"; ?
? ? ? ? ? ? this.menuStrip1.Size = new System.Drawing.Size(676, 24); ?
? ? ? ? ? ? this.menuStrip1.TabIndex = 0; ?
? ? ? ? ? ? this.menuStrip1.Text = "menuStrip1"; ?
? ? ? ? ? ? // ??
? ? ? ? ? ? // 文件FToolStripMenuItem ?
? ? ? ? ? ? // ??
? ? ? ? ? ? this.文件FToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { ?
? ? ? ? ? ? this.新建NToolStripMenuItem, ?
? ? ? ? ? ? this.打開OToolStripMenuItem, ?
? ? ? ? ? ? this.保存SToolStripMenuItem, ?
? ? ? ? ? ? this.toolStripSeparator, ?
? ? ? ? ? ? this.另存為AToolStripMenuItem, ?
? ? ? ? ? ? this.toolStripSeparator1, ?
? ? ? ? ? ? this.打印PToolStripMenuItem, ?
? ? ? ? ? ? this.打印預覽VToolStripMenuItem, ?
? ? ? ? ? ? this.toolStripSeparator2, ?
? ? ? ? ? ? this.退出XToolStripMenuItem}); ?
? ? ? ? ? ? this.文件FToolStripMenuItem.Name = "文件FToolStripMenuItem"; ?
? ? ? ? ? ? this.文件FToolStripMenuItem.Size = new System.Drawing.Size(59, 20); ?
? ? ? ? ? ? this.文件FToolStripMenuItem.Text = "文件(&F)"; ?
? ? ? ? ? ? // ??
? ? ? ? ? ? // 新建NToolStripMenuItem ?
? ? ? ? ? ? // ??
? ? ? ? ? ? this.新建NToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("新建NToolStripMenuItem.Image"))); ?
? ? ? ? ? ? this.新建NToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta; ?
? ? ? ? ? ? this.新建NToolStripMenuItem.Name = "新建NToolStripMenuItem"; ?
? ? ? ? ? ? this.新建NToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N))); ?
? ? ? ? ? ? this.新建NToolStripMenuItem.Size = new System.Drawing.Size(190, 22); ?
? ? ? ? ? ? this.新建NToolStripMenuItem.Text = "新建(&N)"; ?
? ? ? ? ? ? // ??
? ? ? ? ? ? // 打開OToolStripMenuItem ?
? ? ? ? ? ? // ??
? ? ? ? ? ? this.打開OToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("打開OToolStripMenuItem.Image"))); ?
? ? ? ? ? ? this.打開OToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta; ?
? ? ? ? ? ? this.打開OToolStripMenuItem.Name = "打開OToolStripMenuItem"; ?
? ? ? ? ? ? this.打開OToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O))); ?
? ? ? ? ? ? this.打開OToolStripMenuItem.Size = new System.Drawing.Size(190, 22); ?
? ? ? ? ? ? this.打開OToolStripMenuItem.Text = "打開文件1(&O)"; ?
? ? ? ? ? ? this.打開OToolStripMenuItem.Click += new System.EventHandler(this.打開OToolStripMenuItem_Click); ?
? ? ? ? ? ? // ??
? ? ? ? ? ? // 保存SToolStripMenuItem ?
? ? ? ? ? ? // ??
? ? ? ? ? ? this.保存SToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta; ?
? ? ? ? ? ? this.保存SToolStripMenuItem.Name = "保存SToolStripMenuItem"; ?
? ? ? ? ? ? this.保存SToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S))); ?
? ? ? ? ? ? this.保存SToolStripMenuItem.Size = new System.Drawing.Size(190, 22); ?
? ? ? ? ? ? this.保存SToolStripMenuItem.Text = "打開文件2(&S)"; ?
? ? ? ? ? ? this.保存SToolStripMenuItem.Click += new System.EventHandler(this.保存SToolStripMenuItem_Click); ?
? ? ? ? ? ? // ??
? ? ? ? ? ? // toolStripSeparator ?
? ? ? ? ? ? // ??
? ? ? ? ? ? this.toolStripSeparator.Name = "toolStripSeparator"; ?
? ? ? ? ? ? this.toolStripSeparator.Size = new System.Drawing.Size(187, 6); ?
? ? ? ? ? ? // ??
? ? ? ? ? ? // 另存為AToolStripMenuItem ?
? ? ? ? ? ? // ??
? ? ? ? ? ? this.另存為AToolStripMenuItem.Name = "另存為AToolStripMenuItem"; ?
? ? ? ? ? ? this.另存為AToolStripMenuItem.Size = new System.Drawing.Size(190, 22); ?
? ? ? ? ? ? this.另存為AToolStripMenuItem.Text = "關閉兩文件(&A)"; ?
? ? ? ? ? ? this.另存為AToolStripMenuItem.Click += new System.EventHandler(this.另存為AToolStripMenuItem_Click); ?
? ? ? ? ? ? // ??
? ? ? ? ? ? // toolStripSeparator1 ?
? ? ? ? ? ? // ??
? ? ? ? ? ? this.toolStripSeparator1.Name = "toolStripSeparator1"; ?
? ? ? ? ? ? this.toolStripSeparator1.Size = new System.Drawing.Size(187, 6); ?
? ? ? ? ? ? // ??
? ? ? ? ? ? // 打印PToolStripMenuItem ?
? ? ? ? ? ? // ??
? ? ? ? ? ? this.打印PToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("打印PToolStripMenuItem.Image"))); ?
? ? ? ? ? ? this.打印PToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta; ?
? ? ? ? ? ? this.打印PToolStripMenuItem.Name = "打印PToolStripMenuItem"; ?
? ? ? ? ? ? this.打印PToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.P))); ?
? ? ? ? ? ? this.打印PToolStripMenuItem.Size = new System.Drawing.Size(190, 22); ?
? ? ? ? ? ? this.打印PToolStripMenuItem.Text = "打印(&P)"; ?
? ? ? ? ? ? // ??
? ? ? ? ? ? // 打印預覽VToolStripMenuItem ?
? ? ? ? ? ? // ??
? ? ? ? ? ? this.打印預覽VToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("打印預覽VToolStripMenuItem.Image"))); ?
? ? ? ? ? ? this.打印預覽VToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta; ?
? ? ? ? ? ? this.打印預覽VToolStripMenuItem.Name = "打印預覽VToolStripMenuItem"; ?
? ? ? ? ? ? this.打印預覽VToolStripMenuItem.Size = new System.Drawing.Size(190, 22); ?
? ? ? ? ? ? this.打印預覽VToolStripMenuItem.Text = "打印預覽(&V)"; ?
? ? ? ? ? ? // ??
? ? ? ? ? ? // toolStripSeparator2 ?
? ? ? ? ? ? // ??
? ? ? ? ? ? this.toolStripSeparator2.Name = "toolStripSeparator2"; ?
? ? ? ? ? ? this.toolStripSeparator2.Size = new System.Drawing.Size(187, 6); ?
? ? ? ? ? ? // ??
? ? ? ? ? ? // 退出XToolStripMenuItem ?
? ? ? ? ? ? // ??
? ? ? ? ? ? this.退出XToolStripMenuItem.Name = "退出XToolStripMenuItem"; ?
? ? ? ? ? ? this.退出XToolStripMenuItem.Size = new System.Drawing.Size(190, 22); ?
? ? ? ? ? ? this.退出XToolStripMenuItem.Text = "退出(&X)"; ?
? ? ? ? ? ? // ??
? ? ? ? ? ? // 編輯EToolStripMenuItem ?
? ? ? ? ? ? // ??
? ? ? ? ? ? this.編輯EToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { ?
? ? ? ? ? ? this.撤消UToolStripMenuItem, ?
? ? ? ? ? ? this.重復RToolStripMenuItem, ?
? ? ? ? ? ? this.toolStripSeparator3, ?
? ? ? ? ? ? this.剪切TToolStripMenuItem, ?
? ? ? ? ? ? this.復制CToolStripMenuItem, ?
? ? ? ? ? ? this.粘貼PToolStripMenuItem, ?
? ? ? ? ? ? this.toolStripSeparator4, ?
? ? ? ? ? ? this.全選AToolStripMenuItem}); ?
? ? ? ? ? ? this.編輯EToolStripMenuItem.Name = "編輯EToolStripMenuItem"; ?
? ? ? ? ? ? this.編輯EToolStripMenuItem.Size = new System.Drawing.Size(60, 20); ?
? ? ? ? ? ? this.編輯EToolStripMenuItem.Text = "編輯(&E)"; ?
? ? ? ? ? ? // ??
? ? ? ? ? ? // 撤消UToolStripMenuItem ?
? ? ? ? ? ? // ??
? ? ? ? ? ? this.撤消UToolStripMenuItem.Name = "撤消UToolStripMenuItem"; ?
? ? ? ? ? ? this.撤消UToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Z))); ?
? ? ? ? ? ? this.撤消UToolStripMenuItem.Size = new System.Drawing.Size(156, 22); ?
? ? ? ? ? ? this.撤消UToolStripMenuItem.Text = "撤消(&U)"; ?
? ? ? ? ? ? // ??
? ? ? ? ? ? // 重復RToolStripMenuItem ?
? ? ? ? ? ? // ??
? ? ? ? ? ? this.重復RToolStripMenuItem.Name = "重復RToolStripMenuItem"; ?
? ? ? ? ? ? this.重復RToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Y))); ?
? ? ? ? ? ? this.重復RToolStripMenuItem.Size = new System.Drawing.Size(156, 22); ?
? ? ? ? ? ? this.重復RToolStripMenuItem.Text = "重復(&R)"; ?
? ? ? ? ? ? // ??
? ? ? ? ? ? // toolStripSeparator3 ?
? ? ? ? ? ? // ??
? ? ? ? ? ? this.toolStripSeparator3.Name = "toolStripSeparator3"; ?
? ? ? ? ? ? this.toolStripSeparator3.Size = new System.Drawing.Size(153, 6); ?
? ? ? ? ? ? // ??
? ? ? ? ? ? // 剪切TToolStripMenuItem ?
? ? ? ? ? ? // ??
? ? ? ? ? ? this.剪切TToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("剪切TToolStripMenuItem.Image"))); ?
? ? ? ? ? ? this.剪切TToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta; ?
? ? ? ? ? ? this.剪切TToolStripMenuItem.Name = "剪切TToolStripMenuItem"; ?
? ? ? ? ? ? this.剪切TToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.X))); ?
? ? ? ? ? ? this.剪切TToolStripMenuItem.Size = new System.Drawing.Size(156, 22); ?
? ? ? ? ? ? this.剪切TToolStripMenuItem.Text = "剪切(&T)"; ?
? ? ? ? ? ? // ??
? ? ? ? ? ? // 復制CToolStripMenuItem ?
? ? ? ? ? ? // ??
? ? ? ? ? ? this.復制CToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("復制CToolStripMenuItem.Image"))); ?
? ? ? ? ? ? this.復制CToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta; ?
? ? ? ? ? ? this.復制CToolStripMenuItem.Name = "復制CToolStripMenuItem"; ?
? ? ? ? ? ? this.復制CToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C))); ?
? ? ? ? ? ? this.復制CToolStripMenuItem.Size = new System.Drawing.Size(156, 22); ?
? ? ? ? ? ? this.復制CToolStripMenuItem.Text = "復制(&C)"; ?
? ? ? ? ? ? // ??
? ? ? ? ? ? // 粘貼PToolStripMenuItem ?
? ? ? ? ? ? // ??
? ? ? ? ? ? this.粘貼PToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("粘貼PToolStripMenuItem.Image"))); ?
? ? ? ? ? ? this.粘貼PToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta; ?
? ? ? ? ? ? this.粘貼PToolStripMenuItem.Name = "粘貼PToolStripMenuItem"; ?
? ? ? ? ? ? this.粘貼PToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.V))); ?
? ? ? ? ? ? this.粘貼PToolStripMenuItem.Size = new System.Drawing.Size(156, 22); ?
? ? ? ? ? ? this.粘貼PToolStripMenuItem.Text = "粘貼(&P)"; ?
? ? ? ? ? ? // ??
? ? ? ? ? ? // toolStripSeparator4 ?
? ? ? ? ? ? // ??
? ? ? ? ? ? this.toolStripSeparator4.Name = "toolStripSeparator4"; ?
? ? ? ? ? ? this.toolStripSeparator4.Size = new System.Drawing.Size(153, 6); ?
? ? ? ? ? ? // ??
? ? ? ? ? ? // 全選AToolStripMenuItem ?
? ? ? ? ? ? // ??
? ? ? ? ? ? this.全選AToolStripMenuItem.Name = "全選AToolStripMenuItem"; ?
? ? ? ? ? ? this.全選AToolStripMenuItem.Size = new System.Drawing.Size(156, 22); ?
? ? ? ? ? ? this.全選AToolStripMenuItem.Text = "全選(&A)"; ?
? ? ? ? ? ? // ??
? ? ? ? ? ? // 工具TToolStripMenuItem ?
? ? ? ? ? ? // ??
? ? ? ? ? ? this.工具TToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { ?
? ? ? ? ? ? this.自定義CToolStripMenuItem, ?
? ? ? ? ? ? this.選項OToolStripMenuItem}); ?
? ? ? ? ? ? this.工具TToolStripMenuItem.Name = "工具TToolStripMenuItem"; ?
? ? ? ? ? ? this.工具TToolStripMenuItem.Size = new System.Drawing.Size(61, 20); ?
? ? ? ? ? ? this.工具TToolStripMenuItem.Text = "工具(&T)"; ?
? ? ? ? ? ? // ??
? ? ? ? ? ? // 自定義CToolStripMenuItem ?
? ? ? ? ? ? // ??
? ? ? ? ? ? this.自定義CToolStripMenuItem.Name = "自定義CToolStripMenuItem"; ?
? ? ? ? ? ? this.自定義CToolStripMenuItem.Size = new System.Drawing.Size(117, 22); ?
? ? ? ? ? ? this.自定義CToolStripMenuItem.Text = "比較(&C)"; ?
? ? ? ? ? ? this.自定義CToolStripMenuItem.Click += new System.EventHandler(this.自定義CToolStripMenuItem_Click); ?
? ? ? ? ? ? // ??
? ? ? ? ? ? // 選項OToolStripMenuItem ?
? ? ? ? ? ? // ??
? ? ? ? ? ? this.選項OToolStripMenuItem.Name = "選項OToolStripMenuItem"; ?
? ? ? ? ? ? this.選項OToolStripMenuItem.Size = new System.Drawing.Size(117, 22); ?
? ? ? ? ? ? this.選項OToolStripMenuItem.Text = "選項(&O)"; ?
? ? ? ? ? ? // ??
? ? ? ? ? ? // 幫助HToolStripMenuItem ?
? ? ? ? ? ? // ??
? ? ? ? ? ? this.幫助HToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { ?
? ? ? ? ? ? this.內容CToolStripMenuItem, ?
? ? ? ? ? ? this.索引IToolStripMenuItem, ?
? ? ? ? ? ? this.搜索SToolStripMenuItem, ?
? ? ? ? ? ? this.toolStripSeparator5, ?
? ? ? ? ? ? this.關于AToolStripMenuItem}); ?
? ? ? ? ? ? this.幫助HToolStripMenuItem.Name = "幫助HToolStripMenuItem"; ?
? ? ? ? ? ? this.幫助HToolStripMenuItem.Size = new System.Drawing.Size(61, 20); ?
? ? ? ? ? ? this.幫助HToolStripMenuItem.Text = "幫助(&H)"; ?
? ? ? ? ? ? // ??
? ? ? ? ? ? // 內容CToolStripMenuItem ?
? ? ? ? ? ? // ??
? ? ? ? ? ? this.內容CToolStripMenuItem.Name = "內容CToolStripMenuItem"; ?
? ? ? ? ? ? this.內容CToolStripMenuItem.Size = new System.Drawing.Size(128, 22); ?
? ? ? ? ? ? this.內容CToolStripMenuItem.Text = "內容(&C)"; ?
? ? ? ? ? ? // ??
? ? ? ? ? ? // 索引IToolStripMenuItem ?
? ? ? ? ? ? // ??
? ? ? ? ? ? this.索引IToolStripMenuItem.Name = "索引IToolStripMenuItem"; ?
? ? ? ? ? ? this.索引IToolStripMenuItem.Size = new System.Drawing.Size(128, 22); ?
? ? ? ? ? ? this.索引IToolStripMenuItem.Text = "索引(&I)"; ?
? ? ? ? ? ? // ??
? ? ? ? ? ? // 搜索SToolStripMenuItem ?
? ? ? ? ? ? // ??
? ? ? ? ? ? this.搜索SToolStripMenuItem.Name = "搜索SToolStripMenuItem"; ?
? ? ? ? ? ? this.搜索SToolStripMenuItem.Size = new System.Drawing.Size(128, 22); ?
? ? ? ? ? ? this.搜索SToolStripMenuItem.Text = "搜索(&S)"; ?
? ? ? ? ? ? // ??
? ? ? ? ? ? // toolStripSeparator5 ?
? ? ? ? ? ? // ??
? ? ? ? ? ? this.toolStripSeparator5.Name = "toolStripSeparator5"; ?
? ? ? ? ? ? this.toolStripSeparator5.Size = new System.Drawing.Size(125, 6); ?
? ? ? ? ? ? // ??
? ? ? ? ? ? // 關于AToolStripMenuItem ?
? ? ? ? ? ? // ??
? ? ? ? ? ? this.關于AToolStripMenuItem.Name = "關于AToolStripMenuItem"; ?
? ? ? ? ? ? this.關于AToolStripMenuItem.Size = new System.Drawing.Size(128, 22); ?
? ? ? ? ? ? this.關于AToolStripMenuItem.Text = "關于(&A)..."; ?
? ? ? ? ? ? // ??
? ? ? ? ? ? // splitContainer1 ?
? ? ? ? ? ? // ??
? ? ? ? ? ? this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; ?
? ? ? ? ? ? this.splitContainer1.Location = new System.Drawing.Point(0, 24); ?
? ? ? ? ? ? this.splitContainer1.Name = "splitContainer1"; ?
? ? ? ? ? ? // ??
? ? ? ? ? ? // splitContainer1.Panel1 ?
? ? ? ? ? ? // ??
? ? ? ? ? ? this.splitContainer1.Panel1.Controls.Add(this.dataGridView1); ?
? ? ? ? ? ? // ??
? ? ? ? ? ? // splitContainer1.Panel2 ?
? ? ? ? ? ? // ??
? ? ? ? ? ? this.splitContainer1.Panel2.Controls.Add(this.dataGridView2); ?
? ? ? ? ? ? this.splitContainer1.Size = new System.Drawing.Size(676, 528); ?
? ? ? ? ? ? this.splitContainer1.SplitterDistance = 326; ?
? ? ? ? ? ? this.splitContainer1.TabIndex = 1; ?
? ? ? ? ? ? // ??
? ? ? ? ? ? // dataGridView1 ?
? ? ? ? ? ? // ??
? ? ? ? ? ? this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; ?
? ? ? ? ? ? this.dataGridView1.Location = new System.Drawing.Point(0, 28); ?
? ? ? ? ? ? this.dataGridView1.Name = "dataGridView1"; ?
? ? ? ? ? ? this.dataGridView1.RowTemplate.Height = 23; ?
? ? ? ? ? ? this.dataGridView1.Size = new System.Drawing.Size(326, 500); ?
? ? ? ? ? ? this.dataGridView1.TabIndex = 0; ?
? ? ? ? ? ? // ??
? ? ? ? ? ? // dataGridView2 ?
? ? ? ? ? ? // ??
? ? ? ? ? ? this.dataGridView2.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; ?
? ? ? ? ? ? this.dataGridView2.Location = new System.Drawing.Point(0, 28); ?
? ? ? ? ? ? this.dataGridView2.Name = "dataGridView2"; ?
? ? ? ? ? ? this.dataGridView2.RowTemplate.Height = 23; ?
? ? ? ? ? ? this.dataGridView2.Size = new System.Drawing.Size(346, 500); ?
? ? ? ? ? ? this.dataGridView2.TabIndex = 0; ?
? ? ? ? ? ? // ??
? ? ? ? ? ? // openFileDialog1 ?
? ? ? ? ? ? // ??
? ? ? ? ? ? this.openFileDialog1.FileName = "openFileDialog1"; ?
? ? ? ? ? ? // ??
? ? ? ? ? ? // toolStrip1 ?
? ? ? ? ? ? // ??
? ? ? ? ? ? this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { ?
? ? ? ? ? ? this.toolStripButton1}); ?
? ? ? ? ? ? this.toolStrip1.Location = new System.Drawing.Point(0, 24); ?
? ? ? ? ? ? this.toolStrip1.Name = "toolStrip1"; ?
? ? ? ? ? ? this.toolStrip1.Size = new System.Drawing.Size(676, 25); ?
? ? ? ? ? ? this.toolStrip1.TabIndex = 2; ?
? ? ? ? ? ? this.toolStrip1.Text = "toolStrip1"; ?
? ? ? ? ? ? // ??
? ? ? ? ? ? // toolStripButton1 ?
? ? ? ? ? ? // ??
? ? ? ? ? ? this.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; ?
? ? ? ? ? ? this.toolStripButton1.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton1.Image"))); ?
? ? ? ? ? ? this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta; ?
? ? ? ? ? ? this.toolStripButton1.Name = "toolStripButton1"; ?
? ? ? ? ? ? this.toolStripButton1.Size = new System.Drawing.Size(23, 22); ?
? ? ? ? ? ? this.toolStripButton1.Text = "toolStripButton1"; ?
? ? ? ? ? ? // ??
? ? ? ? ? ? // Form1 ?
? ? ? ? ? ? // ??
? ? ? ? ? ? this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); ?
? ? ? ? ? ? this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; ?
? ? ? ? ? ? this.ClientSize = new System.Drawing.Size(676, 552); ?
? ? ? ? ? ? this.Controls.Add(this.toolStrip1); ?
? ? ? ? ? ? this.Controls.Add(this.splitContainer1); ?
? ? ? ? ? ? this.Controls.Add(this.menuStrip1); ?
? ? ? ? ? ? this.MainMenuStrip = this.menuStrip1; ?
? ? ? ? ? ? this.Name = "Form1"; ?
? ? ? ? ? ? this.Text = "Form1"; ?
? ? ? ? ? ? this.menuStrip1.ResumeLayout(false); ?
? ? ? ? ? ? this.menuStrip1.PerformLayout(); ?
? ? ? ? ? ? this.splitContainer1.Panel1.ResumeLayout(false); ?
? ? ? ? ? ? this.splitContainer1.Panel2.ResumeLayout(false); ?
? ? ? ? ? ? this.splitContainer1.ResumeLayout(false); ?
? ? ? ? ? ? ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit(); ?
? ? ? ? ? ? ((System.ComponentModel.ISupportInitialize)(this.dataGridView2)).EndInit(); ?
? ? ? ? ? ? this.toolStrip1.ResumeLayout(false); ?
? ? ? ? ? ? this.toolStrip1.PerformLayout(); ?
? ? ? ? ? ? this.ResumeLayout(false); ?
? ? ? ? ? ? this.PerformLayout(); ?
??
? ? ? ? } ?
?
? ? ? ? #endregion ?
??
? ? ? ? private System.Windows.Forms.MenuStrip menuStrip1; ?
? ? ? ? private System.Windows.Forms.ToolStripMenuItem 文件FToolStripMenuItem; ?
? ? ? ? private System.Windows.Forms.ToolStripMenuItem 新建NToolStripMenuItem; ?
? ? ? ? private System.Windows.Forms.ToolStripMenuItem 打開OToolStripMenuItem; ?
? ? ? ? private System.Windows.Forms.ToolStripSeparator toolStripSeparator; ?
? ? ? ? private System.Windows.Forms.ToolStripMenuItem 保存SToolStripMenuItem; ?
? ? ? ? private System.Windows.Forms.ToolStripMenuItem 另存為AToolStripMenuItem; ?
? ? ? ? private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; ?
? ? ? ? private System.Windows.Forms.ToolStripMenuItem 打印PToolStripMenuItem; ?
? ? ? ? private System.Windows.Forms.ToolStripMenuItem 打印預覽VToolStripMenuItem; ?
? ? ? ? private System.Windows.Forms.ToolStripSeparator toolStripSeparator2; ?
? ? ? ? private System.Windows.Forms.ToolStripMenuItem 退出XToolStripMenuItem; ?
? ? ? ? private System.Windows.Forms.ToolStripMenuItem 編輯EToolStripMenuItem; ?
? ? ? ? private System.Windows.Forms.ToolStripMenuItem 撤消UToolStripMenuItem; ?
? ? ? ? private System.Windows.Forms.ToolStripMenuItem 重復RToolStripMenuItem; ?
? ? ? ? private System.Windows.Forms.ToolStripSeparator toolStripSeparator3; ?
? ? ? ? private System.Windows.Forms.ToolStripMenuItem 剪切TToolStripMenuItem; ?
? ? ? ? private System.Windows.Forms.ToolStripMenuItem 復制CToolStripMenuItem; ?
? ? ? ? private System.Windows.Forms.ToolStripMenuItem 粘貼PToolStripMenuItem; ?
? ? ? ? private System.Windows.Forms.ToolStripSeparator toolStripSeparator4; ?
? ? ? ? private System.Windows.Forms.ToolStripMenuItem 全選AToolStripMenuItem; ?
? ? ? ? private System.Windows.Forms.ToolStripMenuItem 工具TToolStripMenuItem; ?
? ? ? ? private System.Windows.Forms.ToolStripMenuItem 自定義CToolStripMenuItem; ?
? ? ? ? private System.Windows.Forms.ToolStripMenuItem 選項OToolStripMenuItem; ?
? ? ? ? private System.Windows.Forms.ToolStripMenuItem 幫助HToolStripMenuItem; ?
? ? ? ? private System.Windows.Forms.ToolStripMenuItem 內容CToolStripMenuItem; ?
? ? ? ? private System.Windows.Forms.ToolStripMenuItem 索引IToolStripMenuItem; ?
? ? ? ? private System.Windows.Forms.ToolStripMenuItem 搜索SToolStripMenuItem; ?
? ? ? ? private System.Windows.Forms.ToolStripSeparator toolStripSeparator5; ?
? ? ? ? private System.Windows.Forms.ToolStripMenuItem 關于AToolStripMenuItem; ?
? ? ? ? private System.Windows.Forms.SplitContainer splitContainer1; ?
? ? ? ? private System.Windows.Forms.OpenFileDialog openFileDialog1; ?
? ? ? ? private System.Windows.Forms.DataGridView dataGridView1; ?
? ? ? ? private System.Windows.Forms.DataGridView dataGridView2; ?
? ? ? ? private System.Windows.Forms.ToolStrip toolStrip1; ?
? ? ? ? private System.Windows.Forms.ToolStripButton toolStripButton1; ? ?
? ? } ?
} ?
========
C# Parsing 類實現的 PDF 文件分析器
https://www.oschina.net/translate/pdf-file-analyzer-with-csharp-parsing-classes-vers下載示例
下載源代碼
1. 介紹
這個項目讓你可以去讀取并解析一個PDF文件,并將其內部結構展示出來. PDF文件的格式標準文檔可以從Adobe那兒獲取到. 這個項目基于“PDF指南,第六版,Adobe便攜文檔格式1.7 2006年11月”. 它是一個恐怕有1310頁的大部頭. 本文提供了對這份文檔的簡潔概述. 與此相關的項目定義了用來讀取和解析PDF文件的C#類. 為了測試這些類,附帶的測試程序PdfFileAnalyzer讓你可以去讀取一個PDF文件,分析它并展示和保存結果. 程序將PDF文件分割成單獨每頁的描述,字體,圖片和其它對象. 有兩種類型的PDF文件不受此程序的支持: 加密文件和多代文件.
這個程序的1.1版本允許世界各地使用點符號作為小數分隔符的程序員來編譯和運行程序.
1.2版本則修復了一個有關使用跨多個引用流來讀取PDF文檔的問題. 1.2之前的版本對此場景只會以一個對象數字重復的錯誤而終止運行.
如果你對將PDF文件寫入器引入你的應用程序,那就請讀一讀 "PDF 文件寫入程序 C# 類庫" 這篇文章吧.
PDF格式的文件,借助Adobe Acrobat軟件,可以在各種屏幕上顯示查看,使用各種打印機打印。但是,如果使用二進制文件編輯器打開PDF文件,你會發現文件的大部分是不可讀的,有小部分是可讀的,如下:
1 0 obj
<</Lang(en-CA)/MarkInfo<</Marked true>>/Pages 2 0 R
/StructTreeRoot 10 0 R/Type/Catalog>>
endobj
2 0 obj
<</Count 1/Kids[4 0 R]/Type/Pages>>
endobj?
4 0 obj
<</Contents 5 0 R/Group <</CS/DeviceRGB /S/Transparency /Type/Group>>
/MediaBox[0 0 612 792] /Parent 2 0 R
/Resources <</Font <</F1 6 0 R /F2 8 0 R>>
/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>
/StructParents 0/Tabs/S/Type/Page>>
endobj
5 0 obj
<</Filter/FlateDecode/Length 2319>>
stream
. . .
endstream
endobj
看上去,該文件是由嵌套在“n 0 OBJ ”和“ endobj ”關鍵詞之間的對象組成的,術語PDF也就是間接對象的意思。 “obj”前面的數字是對象編號和第幾代對象標識, 雙尖括號中的內容表示數據字典對象,中括號中的內容表示數組對象, 以斜杠/ 開始的內容表示參數名稱 (例如: /Pages)。上例中的第一項 “1 0 obj” 表示文檔的目錄或者文檔的根對象。文檔目錄的字典對象 “/Pages 2 0 R”,指向定義頁碼樹對象的引用。按照這樣推算,編號為2的對象包含指向 “/Kids[4 0 R]”的頁面的引用,是一個頁面文檔。 編號為4的對象是唯一的一個頁面定義, 頁面大小為612*792點, 換句話說,也就是8.5” * 11” (1” 代表72 點)點。該頁面使用了兩種字體F1和F2,這兩種字體分別在編號為6和8的對象中定義。該頁面的內容在編號為5的對象中描述,該對象中包含頁面繪圖的流信息,示例中的 “. . .”代表這部分流信息。如果使用二進制文件編輯器打開PDF文件,會發現這部分流信息看起來是一長串不可讀的隨機數,原因是那是壓縮數據。流數據采用Zlib方法壓縮,壓縮方式由字典對象“/Filter /FlateDecode”描述,被壓縮流的大小為2319字節。解壓這部分流信息,前面幾行內容如下所示:
q
37.08 56.424 537.84 679.18 re
W* n
/P <</MCID 0>> BDC 0.753 g
36.6 465.43 537.96 24.84 re
f*
EMC ?/P <</MCID 1/Lang (x-none)>> BDC BT
/F1 18 Tf
1 0 0 1 39.6 718.8 Tm
0 g
0 G
[(GRA)29(NOTECH LI)-3(MIT)-4(ED)] TJ
ET
這是頁面描述語言的一個小例子。 示例中, “re” 代表矩形,“re” 前面的4個數字代表矩形的位置和大小,依次為:起點橫坐標、起點縱坐標、寬度、高度。
這個簡單的例子演示了PDF文件內部實現的總體思路。從頁面層次結構的根對象開始, 每一頁都定義了諸如字體、圖片、內容流的資源,內容流由操作符和繪制頁面所需要的參數構成。PDF文件分析器會產生一個對象匯總文件,該文件包含非流對象的其他所有對象。每個數據流會被解碼并保存為一個單獨的文件, 頁面描述流保存為文本格式的文件, 圖片流保存為.jpg或.bmp格式的文件,字體流保存為.ttf格式的文件,其他二進制流保存為.bin 格式的文件,文本流保存為.txt格式的文件。通過另一個解析過程,晦澀難懂的頁面描述會被轉換為偽C#代碼,如上例中的頁面描述被轉為:
SaveGraphicsState(); // q
Rectangle(37.08, 56.424, 537.84, 679.18); // re
ClippingPathEvenOddRule(); // W*
NoPaint(); // n
BeginMarkedContentPropList("/P", "<</MCID 0>>"); // BDC
GrayLevelForNonStroking(0.753); // g
Rectangle(36.6, 465.43, 537.96, 24.84); // re
FillEvenOddRule(); // f*
EndMarkedContent(); // EMC
BeginMarkedContentPropList("/P", "<</Lang(x-none)/MCID 1>>"); // BDC
BeginText(); // BT
SelectFontAndSize("/F1", 18); // Tf
TextMatrix(1, 0, 0, 1, 39.6, 718.8); // Tm
GrayLevelForNonStroking(0); // g
GrayLevelForStroking(0); // G
ShowTextWithGlyphPos("[(GRA)29(NOTECH LI)-3(MIT)-4(ED)]"); // TJ
EndTextObject(); // ET
文章接下來的部分將對PDF文件的結構和解析過程進行更為詳細的描述,接下來的章節包括:對象定義,文件結構,文件解析,文件讀取,以及使用PDF文件分析器編程。
3. 免責聲明
pdf 文件分析器能處理大量的文件,這是我在自己的系統上掃描眾多PDF文件的經驗。不過,該程序不支持加密文件或者多個代文件(在對象不為零之前的第二個數字)。在PDF規格文件之中可用功能的數量是非常顯著的。這并不可能為一個單的個開發者系統地測試所有的功能。如果在整個文件分析期間該程序拋出一個異常,將顯示一條錯誤信息,該信息顯示源代碼模塊名和行號。
4.對象定義
PDF文件生成多個對象。在PDF文件分析器項目中每個PDF對象都有一個對應的類。所有這些對象類都派生于PDFbase類。對象類定義源代碼是BasicObjects.cs.確卻地PDF對象定義在Adobe pdf文件 規格第三章之中是有用的
Boolean對象是靠PdfBoolean類來實現的. Boolean在PDF上的定義同C#上的是相同的.
Integer 對象是靠PdfInt類來實現的. PDF上的定義同C#上Int32的定義是相同的.
實數對象是靠PdfReal類來實現的. PDF上的定義同C#上的Single定義相同.
String 對象是靠PdfStr類來實現的. PDF上的定義同C#相比有所不同. String 是用字節構造出來的,而不是字符. 它被包在圓括號()里面. PdfFileAnalyzer會把包含在圓括號中的C#字符串保存成PDF的字符串. PDF的字符串對于ASCII編碼非常有用.
十六進制字符串獨享是靠PdfHex類來實現的. 它是由每字節兩個十六進制數定義,并包在尖括號里面的字符串. PdfFileAnalyzer 將包含在尖括號中的C#字符串保存成PDF十六進制字符串. 對于 PDF 讀取器,字符串和十六進制字符串對象可用于同種目的. 字符串 (AB) 等同于<4142>. PDF 十六進制字符串對于任意編碼的場景非常有用.
Name 對象是靠PdfName類來實現的. Name 對象是由打頭的正斜杠后面跟著一些字符組成的. 例如 /Width. Named 對象用作參數名稱. PdfFileAnalyzer 將正斜杠開頭的C#字符串保存成Name對象.
Null 對象是靠PdfNull類來實現的. PDF 對于null的定義基本上同C#中的是一樣的.
4.2. 復合的對象
Array 對象是靠 PdfArray 類來實現的. PDF 數組是一個封裝在一堆中括號中的對象的集合. 一個數組的對象可以是除了流之外的任何對象.PdfFileAnalyzer 將一個C#數組中的對象保存成PdfBase類
. 因為所有的對象都繼承自PdfBase,所有在這個數組中保存多種類型的對象沒有啥問題. 當數組對象被轉換成一個字符串時(使用ToString()方法), 程序會在首位添加中括號. 數組可以是空的. 下面是一個有六個對象的數組示例: [120 9.56 true null (string) <414243>].
Dictionary 對象是靠PdfDict類實現的. PDF 字典是一組被包入一對雙尖括號中的鍵值對集合. Dictionary 的鍵是一個對象的名稱,而值則可以是除了流之外的任何對象. ?PdfFileAnalyzer 將一個鍵值對保存到PdfPair類中. 鍵是一個C#字符串,而值則是一個PdfBase.PdfDict 類有一個PdfPair類的數組. Dictionary 可以用鍵來訪問. 因而鍵值對的順序沒有啥意義. PdfFileAnalyzer 用鍵來對鍵值對進行排序. 下面是一個有三個鍵值對的字典: <</CropBox [0 0 612 792] /Rotate 0 /Type /Page>>.
Stream 對象是靠PdfStream來實現的. Streams 被用來處理面熟語言,圖形和字體. PDF Stream 由一個字典和一個字節流組成. 字典中定義了流的參數. 比如流對象中字典的一個鍵值對 /Filter. PDF 文檔定義了10種類型的過濾器. PdfFileAnalyzer 支持了4種. 這是我發現在實際場景中只會被用到那4種. 壓縮過濾器 FlateDecode 是現在的PDF寫入器最長被用到的過濾器. FlateDecode支持ZLib解壓縮. LZWDecode 壓縮過濾器在過去些年用的比較多. 為了能讀取比較老的PDF文件, 我們的程序支持這個過濾器. ASCII85Decode 過濾器將可被打印的ASCII轉換成二進制位. DCTDecode 用于JPEG圖像的壓縮.PdfFileAnalyzer 為前三種實現了解壓縮. DCTDecode 流則以文件擴展名.jpg保存. 它是一個可以被展示的圖片文件.
Object 流在PDF 1.5中被引入. 它是一個包含多個間接對象(在下面會描述道)的流. 上面描述的Stream 對象一次只壓縮一個流. Object 流會將所有包含進來的流壓縮到一個壓縮域中.
多引用流在PDF 1.5中被引入. 它是一個包含多引用表格的流,下文會描述到.
內聯圖片對象是靠 PdfInlineImage來實現的. 它是一個帶有一個流的流. 內聯圖片是頁面描述語言的一部分. 它由BI-開頭圖形, ID-圖形數據和EI-結尾圖形這三個操作符組成. BI 和 ID 之間的區域是一個圖形字典,而ID 和 EI 之間的區域則包含圖形數據.
4.3. 間接對象
間接對象是靠 PdfIndirectObject實現的. 它是一個PDF文檔的主要構造塊. 間接對象是任何被包在 “n 0 obj” 和 “endobj”之間的對象. 其它對象可以通過設定“n 0 R”來引用間接對象. “n”代表對象編號. “0”代表生成編號. 這個程序不支持0之外的生成編號. PDF 規范允許其它的編號. 多代生成的理念允許PDF的修改操作是在保留原有文件的基礎上追加變更.
對象引用時一種引用間接對象的方法. 例如 /Pages 2 0 R 是目錄對象中的字典里的一項. 它是一個指向 /Pages 對象的指針. pages對象是編號為2的間接對象.
4.4. 操作符和關鍵詞
操作符和關鍵詞不被認為是PDF對象. 而PdfFileAnalyzer 程序有一個PdfOp 和一個PdfKeyword 類可以從中得到 PdfBase 的類. 在轉換過程中,轉換器為每一個可用的字符序列創建了一個 PdfOp 或者PdfKeyword . Pdf文件規范的附錄A-操作符總結中列出了所有的操作符. 列表中有73個操作符. 下面是一些操作符的示例: BT-打頭的文本對象, G-用于做記號的設置灰度操作, m-移動到, re-矩形和Tc-設置字符間距. 下面是關鍵詞的示例: stream, obj, endobj, xref.
5. 文件結構
PDF文件由四個部分構成: 頭部Header , 主體body, 多引用cross-reference 和附帶簽名 trailer signature.
Header: 頭部是文件的簽名. 它必須是 %PDF-1.x , x 從 0 到 7.
Body: 主體區域包含所有的間接對象.
Cross-reference: 多引用是一個指向所有間接對象的文件位置指針列表. 有兩種類型的多引用表格. 原始的類型有ASCII字符組成. 新式的是一個包含一個間接對象的流. 信息以二進制數字編碼. 在多引用表格的結束部分有一個附件字典. 一個文件可以有超過一個的多引用區域.
Trailer signature: 附帶簽名由關鍵詞“startxref”, 最后一個多引用表格的偏移位, 和結束簽名 %%EOF 組成. 請注意: 附帶簽名是多引用區域的一部分.
6. 文件轉換
PDF 文件是一個字節的序列. 一些字節有特殊的意義.
空格被定義成: null, tab, 換行, 換頁, 回車和間隔.
分隔符被定義成: (, ), <, >, [, ], {, }, /, %, 以及空格字符.
文件轉換是由PdfParser 類來完成的. 開始進行轉換過程是,程序會設置文件需要被轉換區域的位置. ParseNextItem() 是提取下一個對象的方法.
解析器跳過空格符和注釋。如果下一個字節是“(”,判斷對象為一個字符串。如果下一個字節是“[”,判斷對象是一個數組。如果接下來的兩個字節是“<<”,判斷對象是一個字典。如果下一個字節是“<”,判斷對象是一個十六進制字符串。如果下一個字節是“/”,判斷對象是一個名稱。如果下一個字節不是上述任何一種,解析器會采集隨后的字節直到發現定界符。定界符不是當前標記符的一部分。標記符可以是整數,實數,操作符或關鍵詞。在整數的情況下,程序將進一步搜索對象引用“n 0 R”或間接對象“n 0 obj”中 n 為該整數的對象。從 ParseNextItem() 返回的值是第4節“對象的定義”中所述的適當對象。對象的類作為 PdfBase 類返回。
在數組或字典的情況下,程序將執行遞歸調用 ParseNextItem() 來解析數組或字典的內部對象。
7. 文件讀取
PdfDocument 類是 PDF 文件分析的主要類。入口方法是 ReadPdfFile(String FileName)。程序以二進制讀取的方式打開 PDF 文件(一次一個字節)。
文件分析開始于檢查頭部簽名 %PDF-1.x(x為0到7)和結尾簽名%%EOF。有人會認為,所有的 PDF 生成器會把頭部簽名放在文件的零位置,結尾簽名放在文件的最后。不幸的是,實際并非如此。程序必須在文件的兩端搜索這兩個簽名。如果頭部簽名不在零位置,所有間接對象的文件位置的指針也必須調整。
就在結尾簽名的前面有一個指向最后一個交叉引用表開始位置的指針。
========
Windows下的開源二進制文件編輯器HexEdit
http://blog.okbase.net/haobao/archive/65.html?
作者:Andrew Phillips
?
[譯者按]HexEdit是一個偉大的軟件,多少年來一直未伴隨著我們,如今作者釋放出全部源代碼,真的讓我們感激萬分。本文摘錄翻譯了部分,原文請參見http://www.codeproject.com/Articles/135474/HexEdit-Window-Binary-File-Editor
??
介紹
我在去年公測后發布了hexedit 4.0正式版。測試版工作得很好,所以我并沒有急于釋放正式版,有些小BUG需要修復。
?
HexEdit用C++編寫,需要VS2008(帶功能包)、VS2012或后續版本和MFC的支持。你很容易編譯生成它,如果有問題請參閱“生成HexEdit 4.0”章節,現在也有一個工程文件是針對VS2012的。
?
HexEdit(1999年)的第一個版本是開源的,但后來的版本是共享軟件(雖然我一直堅持在做一個免費的版本)。hexedit的2.0開放源代碼,因為它使用了一些BCG商業庫。(BCG庫是一個很好的MFC擴展庫,所以我不后悔使用它。)幸運的是,幾年前,微軟買了BCG代碼,并把它納入MFC。所以,現在hexedit的4.0是第一次開源(見 http://www.hexedit.com);也有一個共享軟件版本,可用于那些想為它支付的朋友(見 http://www.hexeditpro.com),增加了一些小功能。
?
要生成hexedit 4.0中,您只需要Visual Studio,加上一些開放的源代碼和庫(其中大部分來自CodeProject)。您可以使用程序或任何的源代碼,不管出于什么目的,你認為合適的,只要你遵守的相關許可要求(見下文)或任何包含第三方代碼的具體要求。
?
開發歷史
?
我在1997-1998寫的HexEdit,當時工作中需要用到,而那時正缺少十六進制編輯器。
hexedit被設計為易于使用和用戶熟悉的Windows軟件,就像MS Word和Visual Studio。事實上,它借鑒了一些常見的Windows程序的很多思路。
?
代碼文件
HexEdit.h - CHexEditApp 類是應用程序類。
Stdafx.h - 預編譯頭文件
resource.h - 資源 IDs,用于 HexEdit.rc 和C++代碼
?
MainFrm.h - 主程序窗口MFC類
ChildFrm.h - 處理每個文件的窗口類
HexEditDoc.h - CHexEditDoc 類 (參閱 HexEditDoc.cpp, DocData.cpp, Template.cpp, BGSearch.cpp, BGAerial.cpp).
HexEditView.h - CHexEditView 類(參閱 HexEditView.cpp 和 Printer.cpp)
ScrView.h - CScrView 提供了可滾屏的視圖 (CHexEditView的基類)
DataFormatView.h - CDataFormatView 處理模板顯示 (參閱 Template.cpp)
AerialView.h - CAerialView class - 顯示 aerial 視圖 (參閱 BGAerial.cpp)
?
Prop.h - 屬性對話框類 (property sheet, property pages and controls)
BookMarkDlg.h - CBookMarkDlg 對話框用于顯示、添加書簽(參見bookmark.h)?
FindDlg.h - 查找對話框對應類 (property sheet and pages)?
Explorer.h - HexEdit 瀏覽對話框 (dialog and control classes)?
CalcDlg.h - CCalcDlg 計算器對話框類 (see also CalcEdit.h below)
?
Options.h - 選項對話框的屬性頁
DFFD*.h - 模板編輯對話框?
TParseDlg.h - 模板編輯時使用的C/C++分析對話框 (參見TParse.h)
NewFile.h - “新文件”和“插入塊”對話框
OpenSpecialDlg.h - 磁盤編輯打開特殊對話框 (參見SpecialList.h)?
RecentFileDlg.h - 顯示最近使用的文件對話框 (參見HexFileList.h)?
CopyCSrc.h - CCopyCSrc對話框,用于 "Copy As C Source"?
Algorithm.h - CAlgorithm 類用于加密算法對話框
Password.h - CPassword 類用于密碼加密對話框
CompressDlg.h - zlib壓縮對話框
EmailDlg.h - 郵件對話框
Tipdlg.h - 顯示每日技巧
Dialog.h - 在宏中使用的對話框 (GetStr CMacroMessage CSaveMessage CMultiplay
- 還有CFileDialog 派生類,包括 CHexFileDialog)
HexPrintDialog.h - 自定義打印對話框 (重載 MFC CPrintDialog?
SaveDffd.h - 模板沒有保存時的提示對話框 (save/save as/cancel)?
NewScheme.h - small dialog used when creating a new color scheme?
BookmarkFind.h - used by Find dialog when bookmarking found occurrences?
DirDialog.h - directory selection dialog (see below)
?
Splasher.h - CSplashWnd for splash screen (see below)?
TipWnd.h - CWnd derived class to show a small "tip" window (see below)?
TransparentListBox.h, TransparentStatic2.h - transparent controls (see below)?
CCalcEdit.h - CCalcEdit class which handles calculator edit box?
control.h - various text and combo controls used in dialogs and on toolbars
?
GenDockablePane.h - dockable window used to makes Calculator, Find dialog etc dockable?
ResizeCtrl.h - CResizeCtrl (see below)?
BCGMisc.h - a few classes derived from BCG (now MFC) classes?
UserTool.h - CHexEditUserTool is derived from CUserToolto allow command line substition for user tools?
SimpleSplitter.h - CSimpleSplitter is used in Explorer dialog for the split between folder/file sections?
HexEditSplitter.h - CHexEditSplitter allows showing aerial/template views in a split window?
TabView.h - CHexTabView (derived from CTabView allows showing aerial/template views in tabs?
CoordAp.h - CPointAp CSizeAp CRectAp (see below) for 64-bit (vertically) coordinate system
?
TParser.h - 用于TParseDlg的C/C++代碼分析器 (參閱下面的TParseDlg.h)?
HexEditMacro.h - handles recording and playback of Keystroke macros?
HexFileList.h - stores global list of all recent files?
SpecialList.h - stores info about that volumes and raw disks in the system?
Bookmark.h - CBookmarkList class for global storage for bookmarks?
Scheme.h - CScheme stores all color schemes?
NavManager.h - global storage of navigation points?
SystemSound.h - CSystemSound contains static method for getting, setting, playing sounds (see below)?
Timer.h - timer class can time events (see below)
?
UpdateChecker.h - 通過Internet檢測HexEdit的最新版本
Xmltree.h - 封裝了MS XML SDK
BigInter.h - BigInteger 類用于處理大于64位的數字
CFile64.h - CFile64 類用于64位文件處理?
crypto.h - CCrypto 類封裝了 Crypto API
Boyer.h - boyer類用于搜索
range_set.h - template class for set with ranges (see below)?
Expr.h - expr_eval class handles C-like expressions (used in templates etc)?
IntelHex.h - CReadIntelHexand CWriteIntelHex (see below)?
SRecord.h - CReadSRecordand CWriteSRecord (see below)
?
misc.h - 雜項全局函數
md5.h - routines for generating an MD5 checksum
ntapi.h - declarations for direct access to NT API (bypassing Windows) for disk editor?
w2k_def.h - more NT (not 9X) info - included by ntapi.h?
optypes.h - defines unary and binary operations (for Calculator and Operations menu)
SVNRevisionTemplate.h - used by SVN uitlity to create SVNRevision.hSVNRevision.h - just stores?
?
相關內容
下載源代碼:http://www.okbase.net/file/item/19711
更多內容請參見http://www.codeproject.com/Articles/135474/HexEdit-Window-Binary-File-Editor
========
總結
以上是生活随笔為你收集整理的C#二进制文件编程实践的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: C# Image 学习总结
- 下一篇: C# 操作Sql Server 学习总结