最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

C#實(shí)例代碼之抽獎(jiǎng)升級(jí)版可以經(jīng)表格數(shù)據(jù)導(dǎo)入數(shù)據(jù)庫(kù),抽獎(jiǎng)設(shè)置,補(bǔ)抽

 更新時(shí)間:2016年01月11日 11:39:15   作者:Mr_Xing  
這篇文章主要介紹了C#實(shí)例代碼之抽獎(jiǎng)升級(jí)版可以經(jīng)表格數(shù)據(jù)導(dǎo)入數(shù)據(jù)庫(kù),抽獎(jiǎng)設(shè)置,補(bǔ)抽 的相關(guān)資料,需要的朋友可以參考下

我寫代碼一直是這個(gè)風(fēng)格,廢話不多,直接給大家貼代碼,現(xiàn)在還是老規(guī)矩,具體代碼如下所示:

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 = ;//獎(jiǎng)項(xiàng)人數(shù)
int second = ;//防止二次被抽取
Hashtable hashtable = new Hashtable();//存儲(chǔ)編號(hào)
Hashtable hashtable = new Hashtable();//存儲(chǔ)獲獎(jiǎng)名單
Hashtable hashtable = new Hashtable();//避免二次抽獎(jiǎng)
Dictionary<int, string> dict = new Dictionary<int, string>();//詞典存儲(chǔ)所有參賽者
Random rd = new Random();
int time = ;
Label[] label = new Label[];
int index = ;//詞典key鍵值
int total = ;//label個(gè)數(shù)
int num = ;//獲獎(jiǎng)總數(shù)
string s = "";
int End = ;//抽獎(jiǎng)結(jié)束
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 "一等獎(jiǎng)":
second = ;
CurNum = Convert.ToInt(ds.Tables[].Rows[]["PrizeNum"].ToString());
break;
case "二等獎(jiǎng)":
second = ;
CurNum = Convert.ToInt(ds.Tables[].Rows[]["PrizeNum"].ToString());
break;
case "三等獎(jiǎng)":
second = ;
CurNum = Convert.ToInt(ds.Tables[].Rows[]["PrizeNum"].ToString());
break;
case "四等獎(jiǎng)":
second = ;
CurNum = Convert.ToInt(ds.Tables[].Rows[]["PrizeNum"].ToString());
break;
case "五等獎(jiǎng)":
second = ;
CurNum = Convert.ToInt(ds.Tables[].Rows[]["PrizeNum"].ToString());
break;
case "六等獎(jiǎng)":
second = ;
CurNum = Convert.ToInt(ds.Tables[].Rows[]["PrizeNum"].ToString());
break;
case "請(qǐng)選擇":
CurNum = ;
break;
default:
break;
}
}
private void button_Click(object sender, EventArgs e)
{
SqlConnection myconn = new SqlConnection(conn);
myconn.Open();
//未選擇抽獎(jiǎng)項(xiàng)
if (CurNum == )
{
MessageBox.Show("未設(shè)置該獎(jiǎng)項(xiàng)或未選擇獎(jiǎng)項(xiàng),抽獎(jiǎng)沒(méi)有意義?。。?);
return;
}
//處理已經(jīng)被抽獎(jiǎng)項(xiàng)
if (!hashtable.ContainsValue(second))
{
comboBox.Enabled = true;
hashtable.Add(second, second);
}
else
{
MessageBox.Show("此獎(jiǎng)項(xiàng)已經(jīng)被抽過(guò),換個(gè)獎(jiǎng)項(xiàng)吧?");
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);
//設(shè)置有獎(jiǎng)總?cè)藬?shù)
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 = "中獎(jiǎng)名單";
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, myconn);
DataSet ds = new DataSet();
sda.Fill(ds, "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;
}
}
//創(chuàng)建labels
private 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;
}
//清除labels
private 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();
//判斷抽獎(jiǎng)結(jié)束
End = End + CurNum;
if (End == num)
{
button.Enabled = false;
//button.Enabled = false;
button.Enabled = true;
if (MessageBox.Show("抽獎(jiǎng)結(jié)束,是否進(jìn)行補(bǔ)抽,點(diǎn)擊確定進(jìn)行補(bǔ)抽,取消結(jié)束此次抽獎(jiǎng)!", "溫馨提示", 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 關(guān)閉窗口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("請(qǐng)輸入補(bǔ)抽個(gè)數(shù)!!!", "溫馨提示");
return;
}
End = End + CurNum;
if (End > Convert.ToInt(dataGridView.RowCount))
{
button.Enabled = false;
MessageBox.Show("抽獎(jiǎng)超過(guò)參與人數(shù)無(wú)法進(jìn)行補(bǔ)抽!","溫馨提示");
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,Prize from Checked order by PrizeID";
SqlConnection myconn = new SqlConnection(conn);
myconn.Open();
SqlDataAdapter sda = new SqlDataAdapter(sql, myconn);
DataSet ds = new DataSet();
sda.Fill(ds, "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();
}
//先導(dǎo)入到dataSet
public 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 = ;//記錄錯(cuò)誤信息條數(shù)
public static int insertcount = ;//記錄插入成功條數(shù)
public static int updatecount = ;//記錄更新信息條數(shù)
public bool ImportXSL(string home)
{
try
{
DataSet ds = new DataSet();
//取得數(shù)據(jù)集
//調(diào)用上面的函數(shù)
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('{}','{}','{}')", WorkerID, Name,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;
}
}
//導(dǎo)入excle
private void button_Click(object sender, EventArgs e)
{
OpenFileDialog ofd = new OpenFileDialog();
ofd.Filter = "Microsoft Excel files(*.xls)|*.xls;*.xlsx";//過(guò)濾一下,只要表格格式的
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;
} 
}
//導(dǎo)入excle表格
private void button_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection(conn);
con.Open();
//清空主鍵信息,標(biāo)識(shí)自增從開始
string sqlstr = "truncate table Ticket";
SqlCommand comm = new SqlCommand(sqlstr,con);
comm.ExecuteNonQuery();
con.Close();
if (textBox.Text == "")
{
MessageBox.Show("請(qǐng)選擇一張表格?。。?, "溫馨提示");
return;
} 
if (ImportXSL(textBox.Text.ToString()))
{
MessageBox.Show(insertcount + "條數(shù)據(jù)導(dǎo)入成功!" + updatecount + "條數(shù)據(jù)重復(fù)!");
}
textBox.Text = "";
} 
namespace Check_Ticket
{
partial class Btn_UpLoadFile
{
/// <summary>
/// 必需的設(shè)計(jì)器變量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的資源。
/// </summary>
/// <param name="disposing">如果應(yīng)釋放托管資源,為 true;否則為 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows 窗體設(shè)計(jì)器生成的代碼
/// <summary>
/// 設(shè)計(jì)器支持所需的方法 - 不要
/// 使用代碼編輯器修改此方法的內(nèi)容。
/// </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.補(bǔ)抽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 = "獎(jiǎng)項(xiàng)名稱:";
// 
// 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[] {
"請(qǐng)選擇",
"一等獎(jiǎng)",
"二等獎(jiǎng)",
"三等獎(jiǎng)",
"四等獎(jiǎng)",
"五等獎(jiǎng)",
"六等獎(jiǎng)"});
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, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((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 = "開始抽獎(jiǎng)";
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("宋體", F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((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 = "查看獲獎(jiǎng)名單";
this.button.UseVisualStyleBackColor = true;
this.button.Click += new System.EventHandler(this.button_Click);
// 
// button
// 
this.button.Font = new System.Drawing.Font("宋體", F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((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.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("宋體", F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((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 = "設(shè)置獎(jiǎng)項(xiàng)對(duì)應(yīng)人數(shù)";
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("宋體", F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)()));
this.lab.ForeColor = System.Drawing.Color.Blue;
this.lab.Location = new System.Drawing.Point(, );
this.lab.Name = "lab";
this.lab.Size = new System.Drawing.Size(, );
this.lab.TabIndex = ;
this.lab.Text = "獲獎(jiǎng)名單";
// 
// 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.Name = "button";
this.button.Size = new System.Drawing.Size(, );
this.button.TabIndex = ;
this.button.Text = "停止抽獎(jiǎng)";
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("華文新魏", F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)()));
this.lab.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)()))), ((int)(((byte)()))), ((int)(((byte)()))));
this.lab.Location = new System.Drawing.Point(, );
this.lab.Name = "lab";
this.lab.Size = new System.Drawing.Size(, );
this.lab.TabIndex = ;
this.lab.Text = "善林商務(wù)年會(huì)抽獎(jiǎng)活動(dòng)";
// 
// 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("宋體", F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((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 = "關(guān)閉窗口";
this.ToolStripMenuItem.Click += new System.EventHandler(this.關(guān)閉窗口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 = "補(bǔ)抽";
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("宋體", .F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((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 = "個(gè)";
this.ge.Visible = false;
// 
// 補(bǔ)抽ToolStripMenuItem
// 
this.補(bǔ)抽ToolStripMenuItem.Name = "補(bǔ)抽ToolStripMenuItem";
this.補(bǔ)抽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 = "補(bǔ)抽結(jié)束";
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.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);
// 
// 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.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);
// 
// 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("宋體", F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((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 = "抽獎(jiǎng)界面";
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();
}
#endregion
private 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 補(bǔ)抽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;
}
} 
}
}

數(shù)據(jù)庫(kù)設(shè)計(jì)


界面

好了,本文就給大家介紹這么多,有需要的朋友可以參考下本代碼,根據(jù)自己實(shí)際需求適當(dāng)加入,同時(shí)感謝大家一直以來(lái)對(duì)腳本之家網(wǎng)站的支持。

相關(guān)文章

  • C#給PDF文件添加水印

    C#給PDF文件添加水印

    這篇文章主要為大家詳細(xì)介紹了C#給PDF文件添加水印的相關(guān)代碼,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2017-03-03
  • C#瀏覽器提示跨域問(wèn)題解決方案

    C#瀏覽器提示跨域問(wèn)題解決方案

    這篇文章主要介紹了C#瀏覽器提示跨域問(wèn)題解決方案,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下
    2020-07-07
  • 基于C#制作一個(gè)顏色拾取器

    基于C#制作一個(gè)顏色拾取器

    這篇文章主要為大家詳細(xì)介紹了如何基于C#制作一個(gè)顏色拾取器,可以獲取屏幕上任意位置像素的色值,文中的示例代碼講解詳細(xì),有需要的小伙伴可以了解下
    2024-01-01
  • 一起詳細(xì)聊聊C#中的Visitor模式

    一起詳細(xì)聊聊C#中的Visitor模式

    Visitor模式表示一個(gè)作用于某對(duì)象結(jié)構(gòu)中的各元素的操作,下面這篇文章主要給大家介紹了關(guān)于C#中Visitor模式的相關(guān)資料,文中通過(guò)實(shí)例代碼介紹的非常詳細(xì),需要的朋友可以參考下
    2022-05-05
  • C#、ASP.NET通用工具類IsWhat?(可以判斷數(shù)字、身份證、數(shù)據(jù)類型等等)

    C#、ASP.NET通用工具類IsWhat?(可以判斷數(shù)字、身份證、數(shù)據(jù)類型等等)

    這篇文章主要介紹了C#、ASP.NET通用工具類IsWhat?(可以判斷數(shù)字、身份證、數(shù)據(jù)類型等等),本文收集整理了多個(gè)擴(kuò)展函數(shù),簡(jiǎn)單實(shí)用,項(xiàng)目必備,如值范圍、在里面嗎、是null或""?、是零?等等,需要的朋友可以參考下
    2015-06-06
  • C#影院售票系統(tǒng)畢業(yè)設(shè)計(jì)(1)

    C#影院售票系統(tǒng)畢業(yè)設(shè)計(jì)(1)

    這篇文章主要介紹了C#影院售票系統(tǒng)畢業(yè)設(shè)計(jì),獻(xiàn)上了9個(gè)類的設(shè)計(jì),需要的朋友可以參考下
    2015-11-11
  • 基于C#實(shí)現(xiàn)簡(jiǎn)單的隨機(jī)抽獎(jiǎng)小程序

    基于C#實(shí)現(xiàn)簡(jiǎn)單的隨機(jī)抽獎(jiǎng)小程序

    臨近春節(jié),大街小巷的地方都有抽獎(jiǎng)活動(dòng),那么基于C#是如何實(shí)現(xiàn)簡(jiǎn)單的抽獎(jiǎng)程序的呢,下面小編給大家分享了具體代碼,有需要的朋友參考下
    2016-01-01
  • c# 三種方法調(diào)用WebService接口

    c# 三種方法調(diào)用WebService接口

    這篇文章主要介紹了c# 三種方法調(diào)用WebService接口的相關(guān)資料,文中示例代碼非常詳細(xì),幫助大家更好的理解和學(xué)習(xí),感興趣的朋友可以了解下
    2020-07-07
  • C#/VB.NET 在PDF中添加文件包(Portfolio)的方法

    C#/VB.NET 在PDF中添加文件包(Portfolio)的方法

    這篇文章主要介紹了C#/VB.NET 在PDF中添加文件包(Portfolio)的方法,本文通過(guò)實(shí)例代碼給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友參考下吧
    2020-06-06
  • Unity游戲開發(fā)實(shí)現(xiàn)背包系統(tǒng)的示例詳解

    Unity游戲開發(fā)實(shí)現(xiàn)背包系統(tǒng)的示例詳解

    這篇文章主要為大家介紹了Unity游戲開發(fā)實(shí)現(xiàn)背包系統(tǒng)的示例詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2022-08-08

最新評(píng)論

商丘市| 开江县| 治县。| 胶州市| 阜阳市| 鸡西市| 资阳市| 沁水县| 苍山县| 五寨县| 辉县市| 宣化县| 舞钢市| 介休市| 大庆市| 山东省| 天全县| 靖远县| 开平市| 华容县| 河池市| 若羌县| 吴川市| 阜南县| 滁州市| 东辽县| 临潭县| 喜德县| 嘉兴市| 太和县| 景东| 洱源县| 宁明县| 巢湖市| 和田市| 阿克陶县| 册亨县| 堆龙德庆县| 门源| 梓潼县| 如东县|