3-1415926535

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();
        }
    }
}

 

分类:

技术点:

相关文章:

  • 2021-10-22
  • 2021-04-10
  • 2021-09-06
  • 2021-06-16
  • 2022-12-23
  • 2021-12-05
  • 2021-09-01
  • 2021-12-05
猜你喜欢
  • 2021-12-25
  • 2022-02-07
  • 2021-11-13
  • 2022-01-15
  • 2021-10-06
  • 2021-09-25
  • 2021-12-21
相关资源
相似解决方案