当前位置:网站首页>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;
}
}
}
边栏推荐
- Win11自带画图软件怎么显示标尺?
- 用递归进行数组求和
- 百奥赛图与LiberoThera共同开发全人GPCR抗体药物取得里程碑式进展
- Analysis and solution of data and clock mismatch delay in SPI transmission
- [zeloengine] summary of pit filling of reflection system
- Talk about how to use redis to realize distributed locks?
- MySQL intent lock
- 可验证随机函数 VRF
- Food safety - do you really understand the ubiquitous frozen food?
- 【图像隐藏】基于混合 DWT-HD-SVD 的数字图像水印方法技术附matlab代码
猜你喜欢
随机推荐
狂神redis笔记12
Typescript learning 2 - Interface
Upgrade esxi6.7.0 to 7.0u3f (updated on July 12, 2022)
leetcode:528. 按权重随机选择【普通随机失效 + 要用前缀和二分】
权限管理-角色分配菜单
R语言使用gt包和gtExtras包漂亮地显示表格数据:gt_bar_plot函数和gt_plt_bar_pct函数可视化百分比条形图、原始数据的百分比条形、缩放后的数据的百分比条形、指定数据对齐宽度
报表工具的二次革命
Crazy God redis notes 12
Release of v6.5.1/2/3 series of versions of Xingyun housekeeper: the ability of database OpenAPI continues to be strengthened
Baseband simulation system experiment of 4pam in Gaussian channel and Rayleigh channel
Save the image with gaussdb (for redis), and the recommended business can easily reduce the cost by 60%
Introduction to redis
02. 将参数props限制在一个类型的列表中
MySQL isolation level transactions
R语言偏相关性计算(Partial Correlation)、使用ggm包的pcor函数计算偏相关性(Partial Correlations)
终极套娃 2.0 | 云原生交付的封装
MySQL教程68-AS 设置别名
[server data recovery] data recovery cases of raid information loss caused by unexpected power failure of HP EVA server storage
How Google cloud disk is associated with Google colab
The second revolution of reporting tools




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



