接前面的程序.(我今晚在网上,希望哪位大哥帮帮忙,联系!)
我的电子邮件[email protected]
public Form1(){
//
// Required for Windows Form Designer support
//
InitializeComponent(); //
// TODO: Add any constructor code after InitializeComponent call
//
} /// <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.listBox1 = new System.Windows.Forms.ListBox();
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.textBox1 = new System.Windows.Forms.TextBox();
this.textBox2 = new System.Windows.Forms.TextBox();
this.textBox3 = new System.Windows.Forms.TextBox();
this.textBox4 = new System.Windows.Forms.TextBox();
this.SuspendLayout();
// 
// listBox1
// 
this.listBox1.Location = new System.Drawing.Point(16, 8);
this.listBox1.Name = "listBox1";
this.listBox1.Size = new System.Drawing.Size(552, 264);
this.listBox1.TabIndex = 0;
// 
// button1
// 
this.button1.Location = new System.Drawing.Point(120, 296);
this.button1.Name = "button1";
this.button1.TabIndex = 1;
this.button1.Text = "button1";
this.button1.Click += new System.EventHandler(this.button1_Click);
// 
// button2
// 
this.button2.Location = new System.Drawing.Point(240, 296);
this.button2.Name = "button2";
this.button2.TabIndex = 2;
this.button2.Text = "button2";
this.button2.Click += new System.EventHandler(this.button2_Click);
// 
// textBox1
// 
this.textBox1.Location = new System.Drawing.Point(24, 360);
this.textBox1.Name = "textBox1";
this.textBox1.TabIndex = 3;
this.textBox1.Text = "3";
// 
// textBox2
// 
this.textBox2.Location = new System.Drawing.Point(144, 360);
this.textBox2.Name = "textBox2";
this.textBox2.TabIndex = 4;
this.textBox2.Text = "3";
// 
// textBox3
// 
this.textBox3.Location = new System.Drawing.Point(256, 360);
this.textBox3.Name = "textBox3";
this.textBox3.TabIndex = 5;
this.textBox3.Text = "8";
// 
// textBox4
// 
this.textBox4.Location = new System.Drawing.Point(368, 360);
this.textBox4.Name = "textBox4";
this.textBox4.TabIndex = 6;
this.textBox4.Text = "8";
// 
// Form1
// 
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(584, 413);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
  this.textBox4,
  this.textBox3,
  this.textBox2,
  this.textBox1,
  this.button2,
  this.button1,
  this.listBox1});
this.Name = "Form1";
this.Text = "Form1";
this.ResumeLayout(false); }
#endregion /// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(){ 
Application.Run(new Form1());
} private void button1_Click(object sender, System.EventArgs e) {
int count = 0;
string tmp; for(int a=1;a<13;a++){
for(int b=1;b<13;b++){
for(int c=1;c<13;c++){
for(int d=1;d<13;d++){
number[0] = Convert.ToDouble(a);
number[1] = Convert.ToDouble(b);
number[2] = Convert.ToDouble(c);
number[3] = Convert.ToDouble(d); tmp = "";
for(int i=0;i<4;i++){
expression[i] = Convert.ToString(number[i]);
tmp += expression[i];
tmp += ",";
}
tmp = tmp.Substring(0,tmp.Length - 1); if(Search(4)==true){
count++;
if(count>100)return;
listBox1.Items.Add(tmp + ":" + expression[0]);
}
}
}
}
}
} private void button2_Click(object sender, System.EventArgs e) {
number[0] = Convert.ToDouble(textBox1.Text);
number[1] = Convert.ToDouble(textBox2.Text);
number[2] = Convert.ToDouble(textBox3.Text);
number[3] = Convert.ToDouble(textBox4.Text); string tmp = "";
for(int i=0;i<4;i++){
expression[i] = Convert.ToString(number[i]);
tmp += expression[i];
tmp += ",";
}
tmp = tmp.Substring(0,tmp.Length - 1); if(Search(4)==true){
listBox1.Items.Add(tmp + ":" + expression[0]);
}
}
}
}