?? flashget.cs
字號:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace FlashGet
{
/// <summary>
/// Form1 的摘要說明。
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.ComboBox comboBox1;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button3;
/// <summary>
/// 必需的設計器變量。
/// </summary>
private System.ComponentModel.Container components = null;
public Form1()
{
//
// Windows 窗體設計器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 調用后添加任何構造函數代碼
//
}
/// <summary>
/// 清理所有正在使用的資源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows 窗體設計器生成的代碼
/// <summary>
/// 設計器支持所需的方法 - 不要使用代碼編輯器修改
/// 此方法的內容。
/// </summary>
private void InitializeComponent()
{
this.comboBox1 = new System.Windows.Forms.ComboBox();
this.textBox1 = new System.Windows.Forms.TextBox();
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.button3 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// comboBox1
//
this.comboBox1.Items.AddRange(new object[] {
"fgf-",
"fgc-"});
this.comboBox1.Location = new System.Drawing.Point(16, 96);
this.comboBox1.Name = "comboBox1";
this.comboBox1.Size = new System.Drawing.Size(64, 20);
this.comboBox1.TabIndex = 0;
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(16, 48);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(288, 21);
this.textBox1.TabIndex = 1;
this.textBox1.Text = "";
//
// button1
//
this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.button1.Location = new System.Drawing.Point(80, 96);
this.button1.Name = "button1";
this.button1.TabIndex = 2;
this.button1.Text = "計算";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// button2
//
this.button2.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.button2.Location = new System.Drawing.Point(152, 96);
this.button2.Name = "button2";
this.button2.TabIndex = 3;
this.button2.Text = "關于";
//
// button3
//
this.button3.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.button3.Location = new System.Drawing.Point(224, 96);
this.button3.Name = "button3";
this.button3.TabIndex = 4;
this.button3.Text = "退出";
this.button3.Click += new System.EventHandler(this.button3_Click);
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(312, 150);
this.Controls.Add(this.button3);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.comboBox1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "Form1";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load);
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// 應用程序的主入口點。
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void Form1_Load(object sender, System.EventArgs e)
{
comboBox1.SelectedIndex =0;
}
private void button1_Click(object sender, System.EventArgs e)
{
string result=""; //result放結果
int select=comboBox1.SelectedIndex ; //放了個comboBox,Item1="fgf-" Item2="fgc-"
int tmp,div;
int[,] sn=new int [3,4];
int[] val0={0x6b,0x65,0x76}; //即"kevinhyx12345"中的"k","e","i"的HEX
int[] val1={0x6b,0x65,0x69}; //"k","e","v"的HEX
Random rand=new Random (); //用來產生隨機數,當然你也可以叫它“偽隨機數”
for(int j=0;j<3;j++)
{
for(int i=0;i<4;i++)
{
sn[j,i]=rand.Next (0x61,0x7a);
}
}
for(int k=0;k<3;k++) //下面按照程序編
{
switch(k)
{
case 0:
goto n1;
case 1:
goto n2;
case 2:
goto n3;
default:
break;
}
n3:
tmp=sn[k,1]*sn[k,2]+sn[k,3];
goto b;
n2:
tmp=sn[k,1]&sn[k,2];
goto a;
n1:
tmp=(sn[k,1]^sn[k,2])&0x7f;
a:
tmp=sn[k,3]*tmp;
b:
tmp=tmp+sn[k,0]; //這里的sn[k,0]就是要求的字符HEX值,先是隨機產生,等會兒再修改
if(select==0)
{
div=tmp%val0[k];
}
else
{
div=tmp%val1[k];
}
if(k==1) //修改錯誤的隨機數為正確結果
{
sn[k,0]=sn[k,0]-div+8;
}
else
{
sn[k,0]=sn[k,0]-div;
}
}
for(int j=0;j<3;j++)
{
for(int i=0;i<4;i++)
{
char chars=(char)sn[j,i];
result=result+chars.ToString();
}
}
textBox1.Text =comboBox1.SelectedItem.ToString() +result +"0123456789012345678901234567"; //后28個字符就作個個性簽名啦
}
private void button3_Click(object sender, System.EventArgs e)
{
Application.Exit ();
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -