上机课堂随机抽号小程序,选择困难症的福音!


hhhhhh,今天写了一个抽幸运er的小程序,选择困难症再也不用考虑上课提问哪一个同学了!(源代码见最后)

源代码:(只是用了一个简单的Random函数抽号[没有去重],下一步准备把学生名字放进去)

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

namespace num
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            this.BackgroundImage = Image.FromFile("1.jpg");
            this.Text = "幸运鹅";
            this.Icon = new System.Drawing.Icon("2.ico");
        }

        private void Form1_Load(object sender, EventArgs e)
        {           
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Random rd = new Random();
            label1.Text = rd.Next(1,40).ToString();
        }
    }
}

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM