⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 example.cs

📁 Tiger Tree Hash is constructed from two parts, the Tiger Hash Algorithm and Merkle Tree. The origina
💻 CS
字号:
/*
 * 
 *  TigerCS - by Gil Schmidt.
 * 
 *  - this is only a translation for TigerNet by 
 *    Markus Hahn (maakus@earthlink.net) that was
 *    writtin in vb, i only converted it to c#.
 * 
 *  [ contact me at: Gil_Smdt@hotmail.com ]
 * 
 */

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Text;
using System.Security.Cryptography;
using System.IO;
using System.Resources;
using System.Runtime.InteropServices;
using Microsoft.Win32;


namespace ThexCS
{
	public class Example : System.Windows.Forms.Form
	{
		private System.Windows.Forms.TextBox Input;
		private System.Windows.Forms.TextBox Output;
		private System.Windows.Forms.Button GetThexBtn;
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.Label label2;
		private System.ComponentModel.IContainer components;

		public Example()
		{
			InitializeComponent();

		}

		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if (components != null) 
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		private void InitializeComponent()
		{
			this.Input = new System.Windows.Forms.TextBox();
			this.Output = new System.Windows.Forms.TextBox();
			this.GetThexBtn = new System.Windows.Forms.Button();
			this.label1 = new System.Windows.Forms.Label();
			this.label2 = new System.Windows.Forms.Label();
			this.SuspendLayout();
			// 
			// Input
			// 
			this.Input.Location = new System.Drawing.Point(8, 24);
			this.Input.Name = "Input";
			this.Input.Size = new System.Drawing.Size(344, 20);
			this.Input.TabIndex = 1;
			this.Input.Text = "d:\\4";
			// 
			// Output
			// 
			this.Output.Location = new System.Drawing.Point(8, 104);
			this.Output.Name = "Output";
			this.Output.Size = new System.Drawing.Size(344, 20);
			this.Output.TabIndex = 2;
			this.Output.TabStop = false;
			this.Output.Text = "";
			// 
			// GetThexBtn
			// 
			this.GetThexBtn.Location = new System.Drawing.Point(8, 56);
			this.GetThexBtn.Name = "GetThexBtn";
			this.GetThexBtn.TabIndex = 2;
			this.GetThexBtn.Text = "Get TTH";
			this.GetThexBtn.Click += new System.EventHandler(this.GetThex_Click);
			// 
			// label1
			// 
			this.label1.Location = new System.Drawing.Point(8, 88);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(176, 24);
			this.label1.TabIndex = 4;
			this.label1.Text = "Tiger Tree Hash value:";
			// 
			// label2
			// 
			this.label2.Location = new System.Drawing.Point(8, 8);
			this.label2.Name = "label2";
			this.label2.Size = new System.Drawing.Size(192, 16);
			this.label2.TabIndex = 5;
			this.label2.Text = "Filename:";
			// 
			// Example
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.ClientSize = new System.Drawing.Size(360, 130);
			this.Controls.Add(this.label2);
			this.Controls.Add(this.Output);
			this.Controls.Add(this.Input);
			this.Controls.Add(this.label1);
			this.Controls.Add(this.GetThexBtn);
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
			this.Name = "Example";
			this.Text = "Tiger Tree Hash example.";
			this.Load += new System.EventHandler(this.Example_Load);
			this.ResumeLayout(false);

		}
		#endregion

		[STAThread]
		static void Main() 
		{
			Application.Run(new Example());
		}

		private void GetThex_Click(object sender, System.EventArgs e)
		{
/*			Thex TTH = new Thex();
			
			Output.Text = "Gettings TTH for file: " + Input.Text + " ..";
			Output.Text = Base32.ToBase32String(TTH.GetTTH(Input.Text));
			*/
			ThexThreaded TTH = new ThexThreaded();
			Output.Text = Base32.ToBase32String(TTH.GetTTH_Value(Input.Text));

		}

		private void Example_Load(object sender, System.EventArgs e)
		{
			Input.Text = Application.ExecutablePath;
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -