当前位置:网站首页>C# 模拟抽奖
C# 模拟抽奖
2022-07-25 15:56:00 【laocooon】
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;
using System.Threading;
namespace 多线程模拟抽奖
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
bool b=false;
private void button1_Click(object sender, EventArgs e)
{
if (b == false)
{
b = true;
Thread thread = new Thread(playGame);
thread.IsBackground = true;
thread.Start();
button1.Text = "停止";
}
else
{
button1.Text = "开始";
b = false;
}
}
private void playGame()
{
Random random = new Random();
while (b)
{
Thread.Sleep(100);
label1.Text = random.Next(1,10).ToString();
label2.Text = random.Next(1, 10).ToString();
label3.Text = random.Next(1, 10).ToString();
}
}
private void Form1_Load(object sender, EventArgs e)
{
Control.CheckForIllegalCrossThreadCalls=false;
}
}
}
边栏推荐
- Product dynamics - Android 13 high-efficiency adaptation new upgrade
- mysql 隔离级别事务
- leetcode:528. 按权重随机选择【普通随机失效 + 要用前缀和二分】
- leetcode:6127. 优质数对的数目【位运算找规律 + 两数之和大于等于k + 二分】
- [server data recovery] data recovery cases of raid information loss caused by unexpected power failure of HP EVA server storage
- 食品安全丨无处不在的冷冻食品,你真的了解吗?
- mysql意向锁
- Activity review | July 6 Anyuan AI X machine heart series lecture No. 2 | MIT professor Max tegmark shares "symbiotic evolution of human and AI"
- Geogle colab notes 1-- run the.Py file on the cloud hard disk of Geogle
- MySQL explicit lock
猜你喜欢

哪个led显示屏厂家更好

Exploration of 6-wire SPI transmission mode

面试8家公司,1周拿了5个offer,分享一下自己的心得

Baseband simulation system experiment of 4pam in Gaussian channel and Rayleigh channel

基于Caffe ResNet-50网络实现图片分类(仅推理)的实验复现

ML - Speech - traditional speech model

tkinter模块高级操作(一)—— 透明按钮、透明文本框、自定义按钮及自定义文本框

推荐收藏,这或许是最全的类别型特征的编码方法总结

Activity review | July 6 Anyuan AI X machine heart series lecture No. 2 | MIT professor Max tegmark shares "symbiotic evolution of human and AI"

阿唐的小帮手
随机推荐
递归菜单查询(递归:自己查自己)
Product dynamics - Android 13 high-efficiency adaptation new upgrade
leetcode:528. 按权重随机选择【普通随机失效 + 要用前缀和二分】
Crazy God redis notes 12
JWT diagram
如何构建面向海量数据、高实时要求的企业级OLAP数据引擎?
leetcode:6127. 优质数对的数目【位运算找规律 + 两数之和大于等于k + 二分】
mysql意向锁
Record Locks(记录锁)
How matlab produces random complex sequences
国债年化利率太低了,有比国债逆回购年化利率还要高的理财产品吗?
MySQL isolation level transactions
Zhaoqi Kechuang high-level innovation and Entrepreneurship Talent Service Platform at home and abroad, mass entrepreneurship and innovation achievement transformation platform
Circulaindicator component, which makes the indicator style more diversified
Leetcode:154. find the minimum value II in the rotation sort array [about the middle and rear positioning dichotomy of the rotation sort array]
MySQL table read lock
狂神redis笔记12
MySQL tutorial 71-where conditional query data
意向锁(Intention Lock)
没错,请求DNS服务器还可以使用UDP协议