当前位置:网站首页>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教程66-数据表查询语句
- 阿唐的小帮手
- MySQL tutorial 65 data in MySQL operation table
- 面试8家公司,1周拿了5个offer,分享一下自己的心得
- Baseband simulation system experiment of 4pam in Gaussian channel and Rayleigh channel
- 今天睡眠质量记录84分
- leetcode:528. 按权重随机选择【普通随机失效 + 要用前缀和二分】
- Leetcode:154. find the minimum value II in the rotation sort array [about the middle and rear positioning dichotomy of the rotation sort array]
- MQTT X CLI 正式发布:强大易用的 MQTT 5.0 命令行工具
- Food safety - do you really understand the ubiquitous frozen food?
猜你喜欢

Save the image with gaussdb (for redis), and the recommended business can easily reduce the cost by 60%

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

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

Product dynamics - Android 13 high-efficiency adaptation new upgrade

推荐系统-协同过滤在Spark中的实现

"Digital security" alert NFT's seven Scams
![[server data recovery] data recovery cases of raid information loss caused by unexpected power failure of HP EVA server storage](/img/90/51d86111b918eb60761818110cdec4.jpg)
[server data recovery] data recovery cases of raid information loss caused by unexpected power failure of HP EVA server storage
![[zeloengine] summary of pit filling of reflection system](/img/7a/c85ba66c5dd05908b2d784fab306a2.png)
[zeloengine] summary of pit filling of reflection system

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

阿唐的小帮手
随机推荐
开发者如何为React Native选择合适的数据库
哪个led显示屏厂家更好
邮件的收发的展现逻辑之收件箱发件箱以及回复断链的问题
Gap locks
MySQL table read lock
Mysql读写锁
01.一个更简单的方法来传递大量的props
What is a physical firewall? What's the effect?
Simple rotation map and hamster beating
【图像去噪】基于双立方插值和稀疏表示实现图像去噪matlab源码
Intention lock
面试突击:为什么 TCP 需要 3 次握手?
Experimental reproduction of image classification (reasoning only) based on caffe resnet-50 network
权限管理-角色分配菜单
ServletConfig 类和ServletContext 类
[IJCAI 2022] parameter efficient large model sparse training method, which greatly reduces the resources required for sparse training
Exclusive lock
解决Win10磁盘占用100%
MySQL 元数据锁(MDL)
推荐系统-协同过滤在Spark中的实现