資源簡介
C雙色球彩票模擬抽獎、隨機生成號碼系統.rar

代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Text;
using?System.Windows.Forms;
using?System.Data.SqlClient;
//Download?by?http://www.codefans.net
namespace?caipiao
{
????public?partial?class?AddNew?:?Form
????{
????????public?AddNew()
????????{
????????????InitializeComponent();
????????}
????????SqlConnection?conn?=?new?SqlConnection(“?Data?Source=.;Initial?Catalog=caipiao;Integrated?Security=True“);
????????private?void?button1_Click(object?sender?EventArgs?e)
????????{
???????????this.dateTimePicker1.Format?=?DateTimePickerFormat.Custom;
???????????dateTimePicker1.CustomFormat?=?“yyyy年M月d日“;
????????????conn.Open();
????????????string?sql?=?“insert?into?caipiaoku(cpidcprqonetwothreefourfivesixblue)values(‘“?+?this.textBox8.Text?+?“‘‘“?+?this.dateTimePicker1.Value?+?“‘‘“?+?this.textBox1.Text?+?“‘‘“?+?this.textBox2.Text?+?“‘‘“?+?this.textBox3.Text?+?“‘‘“?+?this.textBox4.Text?+?“‘‘“?+?this.textBox5.Text?+?“‘‘“?+?this.textBox6.Text?+?“‘‘“?+?this.textBox7.Text?+?“‘)“;
????????????SqlCommand?scd?=?new?SqlCommand(sql?conn);
????????????scd.ExecuteNonQuery();
????????????conn.Close();
????????????MessageBox.Show(“插入成功!“);
????????????this.textBox1.Text?=?““;
????????????this.textBox2.Text?=?““;
????????????this.textBox3.Text?=?““;
????????????this.textBox4.Text?=?““;
????????????this.textBox5.Text?=?““;
????????????this.textBox6.Text?=?““;
????????????this.textBox7.Text?=?““;
????????????this.textBox8.Text?=?““;
????????????
???????????
????????}
????????private?void?button3_Click(object?sender?EventArgs?e)
????????{
????????????this.textBox1.Text?=?““;
????????????this.textBox2.Text?=?““;
????????????this.textBox3.Text?=?““;
????????????this.textBox4.Text?=?““;
????????????this.textBox5.Text?=?““;
????????????this.textBox6.Text?=?““;
????????????this.textBox7.Text?=?““;
????????????this.textBox8.Text?=?““;
????????????
????????}
????????private?void?button4_Click(object?sender?EventArgs?e)
????????{
????????????this.Close();
????????}
????}
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
-----------?---------??----------?-----??----
??????????????5453575????????????????????59
評論
共有 條評論