• 大小: 194KB
    文件类型: .rar
    金币: 2
    下载: 1 次
    发布日期: 2021-06-17
  • 语言: C#
  • 标签: 1.0  

资源简介

简单的九宫格抽奖系统,入门级,winform系统,高手勿喷……

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace LuckDraw
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

       // private readonly string connString = ConfigurationSettings.AppSettings[“CenterConnectionString“].ToString();
       
        private void button10_Click(object sender EventArgs e)
        {
            this.button10.Enabled = false;
            foreach (Control ctl in Controls)
            {
                if (ctl is Button && ctl.Name != “button10“)
                {
                    ctl.BackColor = Color.NavajoWhite;
                }
            }
            List arrStr = new List() {
                 “宜宾燃面“ “鱼面“ “蔬菜面“ “邓毛肚“ “浅草肆“ “蜀大侠“ “蜀九香“ “谭鸭血“ “大山鱼房“ “耗儿鱼“ “冒菜“ “红戈小馆“ “九尺鸭肠王“
            };
            List arrStrLuck = new List();

            Random rm = new Random();
            for (int i = 0; i < 8; i++)
            {
                int m = rm.Next(arrStr.Count);
                arrStrLuck.Add(arrStr[m]);
                arrStr.Remove(arrStr[m]);
            }
            this.button1.Text = arrStrLuck[0];
            this.button2.Text = arrStrLuck[1];
            this.button3.Text = arrStrLuck[2];
            this.button4.Text = arrStrLuck[3];
            this.button5.Text = arrStrLuck[4];
            this.button6.Text = arrStrLuck[5];
            this.button7.Text = arrStrLuck[6];
            this.button8.Text = arrStrLuck[7];
            //this.button9.Text = arrStrLuck[8];

            int luckMan = rm.Next(arrStrLuck.Count);
            string theMan = arrStrLuck[luckMan];

            Task.Run(() =>
            {
                for (int i = 0; i < 7; i++)
                {
                    for (int j = 1; j < 9; j++)
                    {
                        foreach (Control ctl in Controls)
                        {
                            if (ctl is Button && ctl.Name.Contains(j.ToString()) && ctl.Name != “button10“)
                            {
                                ctl.BackColor = Color.Red;
                                Thread.Sleep(i*i*10);
                                ctl.BackColor = Color.NavajoWhite;
                                continue;
                            }
                        }
                    }
                }

                for (int j = 1; j < 9; j++)
                {
                    foreach (Control ctl in Controls)
                    {
                        if (ctl is Button && ctl.Name.Contains(j.ToString()) && ctl.Name != “button10“)
                        {
                            ctl.BackColor = Colo

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

    ..A..H.     54272  2019-01-17 15:32  LuckDraw\.vs\LuckDraw\v15\.suo

     文件     589824  2019-01-17 15:30  LuckDraw\.vs\LuckDraw\v15\sqlite3\storage.ide

     文件        471  2019-01-17 15:12  LuckDraw\LuckDraw\App.config

     文件      13312  2019-01-17 15:21  LuckDraw\LuckDraw\bin\Debug\LuckDraw.exe

     文件        471  2019-01-17 15:12  LuckDraw\LuckDraw\bin\Debug\LuckDraw.exe.config

     文件      24064  2019-01-17 15:21  LuckDraw\LuckDraw\bin\Debug\LuckDraw.pdb

     文件      11776  2019-01-17 15:30  LuckDraw\LuckDraw\bin\Release\LuckDraw.exe

     文件        471  2019-01-17 15:12  LuckDraw\LuckDraw\bin\Release\LuckDraw.exe.config

     文件      22016  2019-01-17 15:30  LuckDraw\LuckDraw\bin\Release\LuckDraw.pdb

     文件       4147  2019-01-17 15:32  LuckDraw\LuckDraw\Form1.cs

     文件       7612  2019-01-17 15:28  LuckDraw\LuckDraw\Form1.Designer.cs

     文件       5817  2019-01-17 15:28  LuckDraw\LuckDraw\Form1.resx

     文件       3565  2019-01-17 15:20  LuckDraw\LuckDraw\LuckDraw.csproj

     文件        868  2019-01-17 15:12  LuckDraw\LuckDraw\obj\Debug\DesignTimeResolveAssemblyReferences.cache

     文件       7244  2019-01-17 15:14  LuckDraw\LuckDraw\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件         42  2019-01-17 15:14  LuckDraw\LuckDraw\obj\Debug\LuckDraw.csproj.CoreCompileInputs.cache

     文件       1854  2019-01-17 15:21  LuckDraw\LuckDraw\obj\Debug\LuckDraw.csproj.FileListAbsolute.txt

     文件       1012  2019-01-17 15:20  LuckDraw\LuckDraw\obj\Debug\LuckDraw.csproj.GenerateResource.Cache

     文件       2384  2019-01-17 15:12  LuckDraw\LuckDraw\obj\Debug\LuckDraw.csprojResolveAssemblyReference.cache

     文件      13312  2019-01-17 15:21  LuckDraw\LuckDraw\obj\Debug\LuckDraw.exe

     文件       1721  2019-01-17 15:20  LuckDraw\LuckDraw\obj\Debug\LuckDraw.Form1.resources

     文件      24064  2019-01-17 15:21  LuckDraw\LuckDraw\obj\Debug\LuckDraw.pdb

     文件        180  2019-01-17 15:20  LuckDraw\LuckDraw\obj\Debug\LuckDraw.Properties.Resources.resources

     文件          0  2019-01-17 15:12  LuckDraw\LuckDraw\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs

     文件          0  2019-01-17 15:12  LuckDraw\LuckDraw\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs

     文件          0  2019-01-17 15:12  LuckDraw\LuckDraw\obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs

     文件       3584  2019-01-17 15:14  LuckDraw\LuckDraw\obj\Debug\TempPE\Properties.Resources.Designer.cs.dll

     文件       7248  2019-01-17 15:24  LuckDraw\LuckDraw\obj\Release\DesignTimeResolveAssemblyReferencesInput.cache

     文件         42  2019-01-17 15:24  LuckDraw\LuckDraw\obj\Release\LuckDraw.csproj.CoreCompileInputs.cache

     文件        891  2019-01-17 15:24  LuckDraw\LuckDraw\obj\Release\LuckDraw.csproj.FileListAbsolute.txt

............此处省略34个文件信息

评论

共有 条评论