我写代码一直是这个风格,废话不多,直接给大家贴代码,现在还是老规矩,具体代码如下所示:
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Drawing.Imaging;using System.linq;using System.Text;using System.Threading.Tasks;using System.windows.Forms;using System.Data.sqlClIEnt;using System.Collections;using System.IO;namespace Check_Ticket{public partial class Btn_UpLoadfile : Form{string conn = "server=WIN-OUDREHCH;database=Xtf;uID=sa;pwd=";string sql = "";int CurNum = ;//奖项人数int second = ;//防止二次被抽取Hashtable hashtable = new Hashtable();//存储编号Hashtable hashtable = new Hashtable();//存储获奖名单Hashtable hashtable = new Hashtable();//避免二次抽奖Dictionary<int,string> dict = new Dictionary<int,string>();//词典存储所有参赛者Random rd = new Random();int time = ;Label[] label = new Label[];int index = ;//词典key键值int total = ;//label个数int num = ;//获奖总数string s = "";int End = ;//抽奖结束public Btn_UpLoadfile(){InitializeComponent();}private voID Form_Load(object sender,EventArgs e){dataGrIDVIEw.Forecolor = color.Blue;menu.Visible = false;comboBox.Selectedindex = ;this.timer.Interval = ;this.timer.Interval = ;this.timer.Enabled = true;this.windowstate = Formwindowstate.Maximized;}private voID getNumber(string s){sqlConnection myconn = new sqlConnection(conn);myconn.open();sql = "select *from SumPrize";sqlDataAdapter da = new sqlDataAdapter(sql,myconn);DataSet ds = new DataSet();da.Fill(ds);switch (s){case "一等奖":second = ;CurNum = Convert.ToInt(ds.tables[].Rows[]["PriZenum"].ToString());break;case "二等奖":second = ;CurNum = Convert.ToInt(ds.tables[].Rows[]["PriZenum"].ToString());break;case "三等奖":second = ;CurNum = Convert.ToInt(ds.tables[].Rows[]["PriZenum"].ToString());break;case "四等奖":second = ;CurNum = Convert.ToInt(ds.tables[].Rows[]["PriZenum"].ToString());break;case "五等奖":second = ;CurNum = Convert.ToInt(ds.tables[].Rows[]["PriZenum"].ToString());break;case "六等奖":second = ;CurNum = Convert.ToInt(ds.tables[].Rows[]["PriZenum"].ToString());break;case "请选择":CurNum = ;break;default:break;}}private voID button_Click(object sender,EventArgs e){sqlConnection myconn = new sqlConnection(conn);myconn.open();//未选择抽奖项if (CurNum == ){MessageBox.Show("未设置该奖项或未选择奖项,抽奖没有意义!!!");return;}//处理已经被抽奖项if (!hashtable.ContainsValue(second)){comboBox.Enabled = true;hashtable.Add(second,second);}else{MessageBox.Show("此奖项已经被抽过,换个奖项吧?");return;}string prize = comboBox.Text.ToString();string sqlCount = "Select sum(PriZenum) as num from SumPrize";sqlDataAdapter sda = new sqlDataAdapter(sqlCount,myconn);DataSet ds = new DataSet();sda.Fill(ds);//设置有奖总人数num = Convert.ToInt(ds.tables[].Rows[]["num"].ToString());for (int i = ; i < dataGrIDVIEw.RowCount-; i++){dict.Add(index,dataGrIDVIEw.Rows[i].Cells["WorkerID"].Value.ToString() + " " + dataGrIDVIEw.Rows[i].Cells["name"].Value.ToString());index++;}myconn.Close();timer.Start();clearLabel();bornLabel();timer.Enabled = true;comboBox.Enabled = false;}private voID button_Click(object sender,EventArgs e){End = ;menu.Text = "";hashtable.Clear();clearLabel();button.Enabled = true;button.Enabled = true;button.Enabled = false;menu.Visible = false;btnAdd.Visible = false;tbNum.Visible = false;ge.Visible = false;addEnd.Visible = false;lab.Text = "中奖名单";dataGrIDVIEw.Visible = false;string sqlChecked = "delete from Checked";sql = "select *from Ticket";sqlConnection myconn = new sqlConnection(conn);myconn.open();sqlDataAdapter sda = new sqlDataAdapter(sql,myconn);DataSet ds = new DataSet();sda.Fill(ds,"Ticket");dataGrIDVIEw.DataSource = ds;dataGrIDVIEw.DataMember = "Ticket";sqlCommand mycomm = new sqlCommand(sqlChecked,myconn);mycomm.ExecuteNonquery();myconn.Close();}private voID button_Click(object sender,EventArgs e){menu.Visible = false;clearLabel();sql = "select WorkerIDAndname,Prize from Checked order by PrizeID";sqlConnection myconn = new sqlConnection(conn);myconn.open();sqlDataAdapter sda = new sqlDataAdapter(sql,"Checked");dataGrIDVIEw.DataSource = ds;dataGrIDVIEw.DataMember = "Checked";dataGrIDVIEw.Visible = true;menu.Text += "恭喜:\n";for(int i=;i<dataGrIDVIEw.RowCount-;i++){menu.Text += dataGrIDVIEw.Rows[i].Cells["WorkerIDAndname"].Value.ToString() +" 获得"+ dataGrIDVIEw.Rows[i].Cells["Prize"].Value.ToString() + "\n";}menu.Visible = true;timer.Start();myconn.Close();}private voID button_Click(object sender,EventArgs e){new SetPeople().ShowDialog();}private voID comboBox_SelectedValueChanged(object sender,EventArgs e){getNumber(comboBox.Text.ToString());}private voID timer_Tick(object sender,EventArgs e){lab.left = lab.left - ;if (lab.Right < ){lab.left = this.WIDth;}}//创建labelsprivate voID bornLabel(){int i = ;for (i = ; i < CurNum; i++){label[i] = new Label();label[i].Forecolor = color.Blue;label[i].Location = new System.Drawing.Point(,+ (i * ));label[i].Size = new System.Drawing.Size(,);label[i].Backcolor = color.transparent;label[i].Anchor = (AnchorStyles.top);label[i].Font = new System.Drawing.Font("Simsun",FontStyle.Bold);this.Controls.Add(label[i]);}total = i;}//清除labelsprivate voID clearLabel(){for (int i = ; i < total; i++){this.Controls.Remove(label[i]);}}private voID timer_Tick(object sender,EventArgs e){hashtable.Clear();hashtable.Clear();sqlConnection con = new sqlConnection(conn);string sql = "select count(*) from Ticket";sqlCommand com = new sqlCommand(sql,con);con.open();int emcount = Convert.ToInt(com.ExecuteScalar());con.Close();timer.Enabled = true;timer.Interval = time;int i;for (i = ; i < CurNum; i++){int random = Convert.ToInt(rd.Next(,emcount));if (dataGrIDVIEw.Rows[random].Cells["Checked"].Value.ToString().Trim()=="" && !hashtable.ContainsValue(dict[random])){hashtable.Add(random,random);hashtable.Add(dict[random],dict[random]);label[i].Text = dict[random];}else{i--;}}}private voID button_Click(object sender,EventArgs e){comboBox.Enabled = true;sqlConnection con = new sqlConnection(conn);con.open();string sql = "";s = "";timer.Stop();foreach (DictionaryEntry de in hashtable){sql = string.Format("insert into Checked(WorkerIDAndname,Prize,PrizeID) values('{}','{}','{}')",de.Value.ToString(),comboBox.Text.ToString(),second.ToString());sqlCommand com = new sqlCommand(sql,con);com.ExecuteNonquery(); s += de.Value.ToString() +" "; }foreach (DictionaryEntry de in hashtable){dataGrIDVIEw.Rows[Convert.ToInt(de.Key)].Cells["Checked"].Value = "";}lab.Text = "恭喜: " + s + "获得" + comboBox.Text.ToString();//判断抽奖结束End = End + CurNum;if (End == num){button.Enabled = false;//button.Enabled = false;button.Enabled = true;if (MessageBox.Show("抽奖结束,是否进行补抽,点击确定进行补抽,取消结束此次抽奖!","温馨提示",MessageBoxbuttons.YesNo,MessageBoxIcon.Question) == DialogResult.Yes){btnAdd.Visible = true;tbNum.Visible = true;ge.Visible = true;addEnd.Visible = true;}}}private voID timer_Tick(object sender,EventArgs e){menu.top = menu.top - ;if (menu.Bottom < ){menu.top = this.Height-;}}private voID 关闭窗口ToolStripMenuItem_Click(object sender,EventArgs e){this.Close();}private voID btnAdd_Click(object sender,EventArgs e){CurNum = Convert.ToInt(tbNum.Text.ToString());if (CurNum == ){MessageBox.Show("请输入补抽个数!!!","温馨提示");return;}End = End + CurNum;if (End > Convert.ToInt(dataGrIDVIEw.RowCount)){button.Enabled = false;MessageBox.Show("抽奖超过参与人数无法进行补抽!","温馨提示");return;}timer.Start();clearLabel();bornLabel();}private voID addEnd_Click(object sender,EventArgs e){btnAdd.Visible = false;addEnd.Visible = false;tbNum.Visible = false;ge.Visible = false;menu.Visible = false;clearLabel();sql = "select WorkerIDAndname,"Checked");dataGrIDVIEw.DataSource = ds;dataGrIDVIEw.DataMember = "Checked";menu.Text += "恭喜:\n";for (int i = ; i < dataGrIDVIEw.RowCount - ; i++){menu.Text += dataGrIDVIEw.Rows[i].Cells["WorkerIDAndname"].Value.ToString() + " 获得" + dataGrIDVIEw.Rows[i].Cells["Prize"].Value.ToString() + "\n";}menu.Visible = true;timer.Start();myconn.Close();}//先导入到dataSetpublic DataSet getXSLData(string filepath){string strCon = "ProvIDer=Microsoft.ACE.olEDB..;Data Source=" + filepath + ";Extended PropertIEs=\"Excel .;HDR=YES;\"";System.Data.oleDb.oleDbConnection Conn = new System.Data.oleDb.oleDbConnection(strCon);string strCom = "SELECT * FROM [Sheet$]";Conn.open();System.Data.oleDb.oleDbDataAdapter myCommand = new System.Data.oleDb.oleDbDataAdapter(strCom,Conn);DataSet ds = new DataSet();myCommand.Fill(ds,"[Sheet$]");Conn.Close();return ds;}public static int errorcount = ;//记录错误信息条数public static int insertcount = ;//记录插入成功条数public static int updatecount = ;//记录更新信息条数public bool importXSL(string home){try{DataSet ds = new DataSet();//取得数据集//调用上面的函数ds = getXSLData(@home);sqlConnection con = new sqlConnection(conn);con.open();for (int i = ; i < ds.tables[].Rows.Count; i++){string WorkerID = ds.tables[].Rows[i][].ToString();string name = ds.tables[].Rows[i][].ToString();string Checked = ds.tables[].Rows[i][].ToString();if (WorkerID != "" && name != ""){string sq = string.Format("select * from Ticket where WorkerID='{}' and name='{}'",WorkerID,name);sqlCommand selectcom = new sqlCommand(sq,con);int count = Convert.ToInt(selectcom.ExecuteScalar());if (count > ){updatecount++;}else{string s = string.Format("insert into Ticket(WorkerID,name,Checked) values('{}',Checked);sqlCommand insertcom = new sqlCommand(s,con);int result = insertcom.ExecuteNonquery();insertcount++;}}}if (updatecount + insertcount == ds.tables[].Rows.Count){return true;}else{return false;}}catch (Exception e){return false;}}//导入excleprivate voID button_Click(object sender,EventArgs e){OpenfileDialog ofd = new OpenfileDialog();ofd.Filter = "Microsoft Excel files(*.xls)|*.xls;*.xlsx";//过滤一下,只要表格格式的ofd.RestoreDirectory = true;ofd.FilterIndex = ;ofd.AddExtension = true;ofd.CheckfileExists = true;ofd.CheckPathExists = true;ofd.ShowHelp = true;//是否显示帮助按钮if (ofd.ShowDialog() == DialogResult.OK){this.textBox.Text = ofd.filename;} }//导入excle表格private voID button_Click(object sender,EventArgs e){sqlConnection con = new sqlConnection(conn);con.open();//清空主键信息,标识自增从开始string sqlstr = "truncate table Ticket";sqlCommand comm = new sqlCommand(sqlstr,con);comm.ExecuteNonquery();con.Close();if (textBox.Text == ""){MessageBox.Show("请选择一张表格!!!","温馨提示");return;} if (importXSL(textBox.Text.ToString())){MessageBox.Show(insertcount + "条数据导入成功!" + updatecount + "条数据重复!");}textBox.Text = "";} namespace Check_Ticket{partial class Btn_UpLoadfile{/// <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(){this.components = new System.ComponentModel.Container();this.lab = new System.windows.Forms.Label();this.comboBox = new System.windows.Forms.ComboBox();this.button = new System.windows.Forms.button();this.dataGrIDVIEw = new System.windows.Forms.DataGrIDVIEw();this.button = new System.windows.Forms.button();this.button = new System.windows.Forms.button();this.dataGrIDVIEw = new System.windows.Forms.DataGrIDVIEw();this.button = new System.windows.Forms.button();this.lab = new System.windows.Forms.Label();this.timer = new System.windows.Forms.Timer(this.components);this.timer = new System.windows.Forms.Timer(this.components);this.button = new System.windows.Forms.button();this.lab = new System.windows.Forms.Label();this.timer = new System.windows.Forms.Timer(this.components);this.menu = new System.windows.Forms.Label();this.menuStrip = new System.windows.Forms.MenuStrip();this.ToolStripMenuItem = new System.windows.Forms.ToolStripMenuItem();this.附加功能ToolStripMenuItem = new System.windows.Forms.ToolStripMenuItem();this.label = new System.windows.Forms.Label();this.btnAdd = new System.windows.Forms.button();this.tbNum = new System.windows.Forms.TextBox();this.ge = new System.windows.Forms.Label();this.补抽ToolStripMenuItem = new System.windows.Forms.ToolStripMenuItem();this.addEnd = new System.windows.Forms.button();this.openfileDialog = new System.windows.Forms.OpenfileDialog();this.button = new System.windows.Forms.button();this.textBox = new System.windows.Forms.TextBox();this.button = new System.windows.Forms.button();((System.ComponentModel.ISupportinitialize)(this.dataGrIDVIEw)).BeginInit();((System.ComponentModel.ISupportinitialize)(this.dataGrIDVIEw)).BeginInit();this.menuStrip.SuspendLayout();this.SuspendLayout();// // lab// this.lab.autoSize = true;this.lab.Backcolor = System.Drawing.color.Blue;this.lab.Font = new System.Drawing.Font("微软雅黑",.F,System.Drawing.FontStyle.Bold,system.drawing.graphicsUnit.Point,((byte)()));this.lab.Forecolor = System.Drawing.color.Red;this.lab.Location = new System.Drawing.Point(,);this.lab.name = "lab";this.lab.Size = new System.Drawing.Size(,);this.lab.TabIndex = ;this.lab.Text = "奖项名称:";// // comboBox// this.comboBox.DropDownStyle = System.windows.Forms.ComboBoxStyle.DropDownList;this.comboBox.Forecolor = System.Drawing.color.Red;this.comboBox.FormattingEnabled = true;this.comboBox.Items.AddRange(new object[] {"请选择","一等奖","二等奖","三等奖","四等奖","五等奖","六等奖"});this.comboBox.Location = new System.Drawing.Point(,);this.comboBox.name = "comboBox";this.comboBox.Size = new System.Drawing.Size(,);this.comboBox.TabIndex = ;this.comboBox.SelectedValueChanged += new System.EventHandler(this.comboBox_SelectedValueChanged);// // button// this.button.Enabled = false;this.button.Font = new System.Drawing.Font("宋体",F,((byte)()));this.button.Forecolor = System.Drawing.color.FromArgb(((int)(((byte)()))),((int)(((byte)()))),((int)(((byte)()))));this.button.Location = new System.Drawing.Point(,);this.button.name = "button";this.button.Size = new System.Drawing.Size(,);this.button.TabIndex = ;this.button.Text = "开始抽奖";this.button.UseVisualStyleBackcolor = true;this.button.Click += new System.EventHandler(this.button_Click);// // dataGrIDVIEw// this.dataGrIDVIEw.ColumnheadersHeightSizeMode = System.windows.Forms.DataGrIDVIEwColumnheadersHeightSizeMode.autoSize;this.dataGrIDVIEw.Location = new System.Drawing.Point(,);this.dataGrIDVIEw.name = "dataGrIDVIEw";this.dataGrIDVIEw.RowTemplate.Height = ;this.dataGrIDVIEw.Size = new System.Drawing.Size(,);this.dataGrIDVIEw.TabIndex = ;this.dataGrIDVIEw.Visible = false;// // button// this.button.Enabled = false;this.button.Font = new System.Drawing.Font("宋体",);this.button.TabIndex = ;this.button.Text = "查看获奖名单";this.button.UseVisualStyleBackcolor = true;this.button.Click += new System.EventHandler(this.button_Click);// // button// this.button.Font = new System.Drawing.Font("宋体",);this.button.TabIndex = ;this.button.Text = "人员加载";this.button.UseVisualStyleBackcolor = true;this.button.Click += new System.EventHandler(this.button_Click);// // dataGrIDVIEw// this.dataGrIDVIEw.autoSizeColumnsMode = System.windows.Forms.DataGrIDVIEwautoSizeColumnsMode.AllCells;this.dataGrIDVIEw.ColumnheadersHeightSizeMode = System.windows.Forms.DataGrIDVIEwColumnheadersHeightSizeMode.autoSize;this.dataGrIDVIEw.GrIDcolor = System.Drawing.color.Black;this.dataGrIDVIEw.Location = new System.Drawing.Point(,);this.dataGrIDVIEw.name = "dataGrIDVIEw";this.dataGrIDVIEw.RowheadersVisible = false;this.dataGrIDVIEw.RowTemplate.Height = ;this.dataGrIDVIEw.Size = new System.Drawing.Size(,);this.dataGrIDVIEw.TabIndex = ;this.dataGrIDVIEw.Visible = false;// // button// this.button.Font = new System.Drawing.Font("宋体",);this.button.TabIndex = ;this.button.Text = "设置奖项对应人数";this.button.UseVisualStyleBackcolor = true;this.button.Click += new System.EventHandler(this.button_Click);// // lab// this.lab.autoSize = true;this.lab.Backcolor = System.Drawing.color.transparent;this.lab.Font = new System.Drawing.Font("宋体",System.Drawing.FontStyle.Regular,((byte)()));this.lab.Forecolor = System.Drawing.color.Blue;this.lab.Location = new System.Drawing.Point(,);this.lab.TabIndex = ;this.lab.Text = "获奖名单";// // timer// this.timer.Tick += new System.EventHandler(this.timer_Tick);// // timer// this.timer.Tick += new System.EventHandler(this.timer_Tick);// // button// this.button.Enabled = false;this.button.Forecolor = System.Drawing.color.Red;this.button.Location = new System.Drawing.Point(,);this.button.TabIndex = ;this.button.Text = "停止抽奖";this.button.UseVisualStyleBackcolor = true;this.button.Click += new System.EventHandler(this.button_Click);// // lab// this.lab.Anchor = System.windows.Forms.AnchorStyles.top;this.lab.autoSize = true;this.lab.Backcolor = System.Drawing.color.transparent;this.lab.Font = new System.Drawing.Font("华文新魏",((byte)()));this.lab.Forecolor = System.Drawing.color.FromArgb(((int)(((byte)()))),((int)(((byte)()))));this.lab.Location = new System.Drawing.Point(,);this.lab.TabIndex = ;this.lab.Text = "善林商务年会抽奖活动";// // timer// this.timer.Tick += new System.EventHandler(this.timer_Tick);// // menu// this.menu.autoSize = true;this.menu.Backcolor = System.Drawing.color.transparent;this.menu.Font = new System.Drawing.Font("宋体",((byte)()));this.menu.Forecolor = System.Drawing.color.Blue;this.menu.Location = new System.Drawing.Point(,);this.menu.name = "menu";this.menu.Size = new System.Drawing.Size(,);this.menu.TabIndex = ;// // menuStrip// this.menuStrip.Backcolor = System.Drawing.color.transparent;this.menuStrip.Items.AddRange(new System.windows.Forms.ToolStripItem[] {this.ToolStripMenuItem,this.附加功能ToolStripMenuItem});this.menuStrip.Location = new System.Drawing.Point(,);this.menuStrip.name = "menuStrip";this.menuStrip.Size = new System.Drawing.Size(,);this.menuStrip.TabIndex = ;this.menuStrip.Text = "menuStrip";// // ToolStripMenuItem// this.ToolStripMenuItem.Backcolor = System.Drawing.color.transparent;this.ToolStripMenuItem.Forecolor = System.Drawing.color.Blue;this.ToolStripMenuItem.name = "ToolStripMenuItem";this.ToolStripMenuItem.Size = new System.Drawing.Size(,);this.ToolStripMenuItem.Text = "关闭窗口";this.ToolStripMenuItem.Click += new System.EventHandler(this.关闭窗口ToolStripMenuItem_Click);// // 附加功能ToolStripMenuItem// this.附加功能ToolStripMenuItem.name = "附加功能ToolStripMenuItem";this.附加功能ToolStripMenuItem.Size = new System.Drawing.Size(,);// // label// this.label.Anchor = System.windows.Forms.AnchorStyles.top;this.label.autoSize = true;this.label.Forecolor = System.Drawing.color.Yellow;this.label.Location = new System.Drawing.Point(,);this.label.name = "label";this.label.Size = new System.Drawing.Size(,);this.label.TabIndex = ;this.label.Text = "---------------------------------------------------------------------------------" +"------";// // btnAdd// this.btnAdd.Forecolor = System.Drawing.color.Indigo;this.btnAdd.Location = new System.Drawing.Point(,);this.btnAdd.name = "btnAdd";this.btnAdd.Size = new System.Drawing.Size(,);this.btnAdd.TabIndex = ;this.btnAdd.Text = "补抽";this.btnAdd.UseVisualStyleBackcolor = true;this.btnAdd.Visible = false;this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);// // tbNum// this.tbNum.Location = new System.Drawing.Point(,);this.tbNum.name = "tbNum";this.tbNum.Size = new System.Drawing.Size(,);this.tbNum.TabIndex = ;this.tbNum.Text = "";this.tbNum.Visible = false;// // ge// this.ge.autoSize = true;this.ge.Font = new System.Drawing.Font("宋体",((byte)()));this.ge.Location = new System.Drawing.Point(,);this.ge.name = "ge";this.ge.Size = new System.Drawing.Size(,);this.ge.TabIndex = ;this.ge.Text = "个";this.ge.Visible = false;// // 补抽ToolStripMenuItem// this.补抽ToolStripMenuItem.name = "补抽ToolStripMenuItem";this.补抽ToolStripMenuItem.Size = new System.Drawing.Size(,);// // addEnd// this.addEnd.Location = new System.Drawing.Point(,);this.addEnd.name = "addEnd";this.addEnd.Size = new System.Drawing.Size(,);this.addEnd.TabIndex = ;this.addEnd.Text = "补抽结束";this.addEnd.UseVisualStyleBackcolor = true;this.addEnd.Visible = false;this.addEnd.Click += new System.EventHandler(this.addEnd_Click);// // openfileDialog// this.openfileDialog.filename = "openfileDialog";// // button// this.button.Location = new System.Drawing.Point(,);this.button.TabIndex = ;this.button.Text = "选择文件";this.button.UseVisualStyleBackcolor = true;this.button.Click += new System.EventHandler(this.button_Click);// // textBox// this.textBox.Location = new System.Drawing.Point(,);this.textBox.name = "textBox";this.textBox.Size = new System.Drawing.Size(,);this.textBox.TabIndex = ;// // button// this.button.Location = new System.Drawing.Point(,);this.button.TabIndex = ;this.button.Text = "上传文件";this.button.UseVisualStyleBackcolor = true;this.button.Click += new System.EventHandler(this.button_Click);// // Btn_UpLoadfile// this.autoScaleDimensions = new System.Drawing.Sizef(F,F);this.autoScaleMode = System.windows.Forms.autoScaleMode.Font;this.Backcolor = System.Drawing.color.Red;this.ClIEntSize = new System.Drawing.Size(,);this.Controls.Add(this.button);this.Controls.Add(this.textBox);this.Controls.Add(this.button);this.Controls.Add(this.addEnd);this.Controls.Add(this.ge);this.Controls.Add(this.tbNum);this.Controls.Add(this.btnAdd);this.Controls.Add(this.label);this.Controls.Add(this.menu);this.Controls.Add(this.lab);this.Controls.Add(this.button);this.Controls.Add(this.lab);this.Controls.Add(this.button);this.Controls.Add(this.dataGrIDVIEw);this.Controls.Add(this.button);this.Controls.Add(this.button);this.Controls.Add(this.comboBox);this.Controls.Add(this.dataGrIDVIEw);this.Controls.Add(this.button);this.Controls.Add(this.lab);this.Controls.Add(this.menuStrip);this.DoubleBuffered = true;this.Font = new System.Drawing.Font("宋体",((byte)()));this.Forecolor = System.Drawing.color.Purple;this.FormborderStyle = System.windows.Forms.FormborderStyle.None;this.MainMenuStrip = this.menuStrip;this.MaximumSize = new System.Drawing.Size(,);this.MinimumSize = new System.Drawing.Size(,);this.name = "Btn_UpLoadfile";this.ShowIcon = false;this.Text = "抽奖界面";this.Load += new System.EventHandler(this.Form_Load);((System.ComponentModel.ISupportinitialize)(this.dataGrIDVIEw)).EndInit();((System.ComponentModel.ISupportinitialize)(this.dataGrIDVIEw)).EndInit();this.menuStrip.ResumeLayout(false);this.menuStrip.Performlayout();this.ResumeLayout(false);this.Performlayout();}#endregionprivate System.windows.Forms.Label lab;private System.windows.Forms.ComboBox comboBox;private System.windows.Forms.button button;private System.windows.Forms.DataGrIDVIEw dataGrIDVIEw;private System.windows.Forms.button button;private System.windows.Forms.button button;private System.windows.Forms.DataGrIDVIEw dataGrIDVIEw;private System.windows.Forms.button button;private System.windows.Forms.Label lab;private System.windows.Forms.Timer timer;private System.windows.Forms.Timer timer;private System.windows.Forms.button button;private System.windows.Forms.Label lab;private System.windows.Forms.Timer timer;private System.windows.Forms.Label menu;private System.windows.Forms.MenuStrip menuStrip;private System.windows.Forms.ToolStripMenuItem ToolStripMenuItem;private System.windows.Forms.Label label;private System.windows.Forms.button btnAdd;private System.windows.Forms.TextBox tbNum;private System.windows.Forms.Label ge;private System.windows.Forms.ToolStripMenuItem 附加功能ToolStripMenuItem;private System.windows.Forms.ToolStripMenuItem 补抽ToolStripMenuItem;private System.windows.Forms.button addEnd;private System.windows.Forms.OpenfileDialog openfileDialog;private System.windows.Forms.button button;private System.windows.Forms.TextBox textBox;private System.windows.Forms.button button;}} }}
数据库设计
界面
好了,本文就给大家介绍这么多,有需要的朋友可以参考下本代码,根据自己实际需求适当加入,同时感谢大家一直以来对编程小技巧网站的支持。
总结以上是内存溢出为你收集整理的C#实例代码之抽奖升级版可以经表格数据导入数据库,抽奖设置,补抽全部内容,希望文章能够帮你解决C#实例代码之抽奖升级版可以经表格数据导入数据库,抽奖设置,补抽所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)