当前位置:网站首页>C # simulation lottery
C # simulation lottery
2022-07-25 16:14: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 Multi thread simulation lottery
{
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 = " stop it ";
}
else
{
button1.Text = " Start ";
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;
}
}
}
边栏推荐
- MySQL tutorial 66 data table query statement
- Gap locks
- 【IJCAI 2022】参数高效的大模型稀疏训练方法,大幅减少稀疏训练所需资源
- Endnote cannot edit range resolution
- Endnote add Chinese gbt7714 style how to quote documents in word
- How Google cloud disk is associated with Google colab
- Shared lock
- C# 音乐
- Ice 100g network card fragment message hash problem
- [IJCAI 2022] parameter efficient large model sparse training method, which greatly reduces the resources required for sparse training
猜你喜欢
![Leetcode:528. select randomly according to the weight [ordinary random failure + prefix and dichotomy]](/img/fb/8178388f8c9ac80d95140378d24238.png)
Leetcode:528. select randomly according to the weight [ordinary random failure + prefix and dichotomy]

一文入门Redis
![[Shakespeare: keep the fun of being a man]](/img/71/6476f2d58255c78ac8f58fbfc6a0c9.png)
[Shakespeare: keep the fun of being a man]

How matlab saves all the data after running

Talk about how to use redis to realize distributed locks?

MQTT X CLI 正式发布:强大易用的 MQTT 5.0 命令行工具

如何构建面向海量数据、高实时要求的企业级OLAP数据引擎?

测试驱动开发(TDD)在线练功房 | 9月17日开课

电阻电路的等效变化(Ⅱ)

SVD singular value decomposition derivation and application and signal recovery
随机推荐
【图像隐藏】基于混合 DWT-HD-SVD 的数字图像水印方法技术附matlab代码
MySQL教程71-WHERE 条件查询数据
C# 音乐
【服务器数据恢复】HP EVA服务器存储意外断电导致RAID信息丢失的数据恢复案例
Leetcode:154. find the minimum value II in the rotation sort array [about the middle and rear positioning dichotomy of the rotation sort array]
Win11桌面切换快捷键是什么?Win11快速切换桌面的方法
Sword finger offer | number of 1 in binary
Endnote add Chinese gbt7714 style how to quote documents in word
测试驱动开发(TDD)在线练功房 | 9月17日开课
邮件的收发的展现逻辑之收件箱发件箱以及回复断链的问题
MySQL全局锁
MQTT X CLI 正式发布:强大易用的 MQTT 5.0 命令行工具
终极套娃 2.0 | 云原生交付的封装
mysql 表读锁
MySQL tutorial 68-as setting alias
[server data recovery] data recovery cases of raid information loss caused by unexpected power failure of HP EVA server storage
一文理解分布式开发中的服务治理
mysql意向锁
食品安全丨无处不在的冷冻食品,你真的了解吗?
I interviewed 8 companies and got 5 offers in a week. Share my experience