Winform 公司年會抽獎系統

1,點擊開始按鈕以後能夠隨機公司員工的姓名,圖像。數組

2,中獎人員會在列表中顯示。ide

3,關於一等獎,二等獎,三等獎是主持人隨機的。this

4,效果圖展現spa

 4.1主頁圖.net

 4.2抽獎主頁code

 4.3開始抽獎orm

 4.4 中獎人名單blog

 1   private void LuckyForm_Load(object sender, EventArgs e)
 2         {
 3             try
 4             {
 5                 lblset.Text = UserHelper.one.ToString();  //設置名額
 6                 lblcc.Text = readnum(1).ToString();    //抽出名額
 7                 zhongjianglist();//中獎列表
 8 
 9                // 全部圖片路徑
10                 string path = Application.StartupPath + @"\staff";
11 
12                 //設置抽獎人員
13                 DirectoryInfo dir = new DirectoryInfo(path);
14                 FileInfo[] ff = dir.GetFiles("*.jpg");
15                 i = ff.Length;
16                 pernum = ff.Length;   //總人數
17                 //存放名字的數組
18                UserHelper.sname = new string[i];
19                 int ix = 0;
20                 foreach (FileInfo f in ff)
21                 {
22                    UserHelper.sname[ix] = f.Name.ToString().Substring(0, f.Name.Length - 4);
23                    ilface.Images.Add(f.Name, Image.FromFile(f.FullName));
24                    ix++;
25                 } 
26                 pernum = i;
27 
28                 //加載單項抽出的人數
29                 save = Convert.ToInt32(lblcc.Text);
30                 //加載抽出的總人數
31                 wined = readnum(1) + readnum(2) + readnum(3) + readnum(4) + readnum(5) + readnum(0);
32             }
33             catch (Exception)
34             {
35                 MessageBox.Show("抱歉,啓動失敗!","系統",MessageBoxButtons.OK,MessageBoxIcon.Exclamation);
36                 this.Close();
37             }
38         }  
View Code

若須要源碼能夠聯繫我www.jiangyong.net.cn圖片

相關文章
相關標籤/搜索