当前位置:网站首页>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;
}
}
}
边栏推荐
- 2w字详解数据湖:概念、特征、架构与案例
- 【ZeloEngine】反射系统填坑小结
- R语言使用gt包和gtExtras包漂亮地显示表格数据:gt_bar_plot函数和gt_plt_bar_pct函数可视化百分比条形图、原始数据的百分比条形、缩放后的数据的百分比条形、指定数据对齐宽度
- 今天去 OPPO 面试,被问麻了
- MATLAB optimization tool manopt installation
- Circulaindicator component, which makes the indicator style more diversified
- [IJCAI 2022] parameter efficient large model sparse training method, which greatly reduces the resources required for sparse training
- MySQL explicit lock
- Waterfall flow layout
- Endnote cannot edit range resolution
猜你喜欢

用递归进行数组求和

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

Experimental reproduction of image classification (reasoning only) based on caffe resnet-50 network

How matlab produces random complex sequences

Win11桌面切换快捷键是什么?Win11快速切换桌面的方法

开发者如何为React Native选择合适的数据库

Visual studio 2022 view class diagram

哪个led显示屏厂家更好
![[zeloengine] summary of pit filling of reflection system](/img/7a/c85ba66c5dd05908b2d784fab306a2.png)
[zeloengine] summary of pit filling of reflection system
![[JS advanced] JS regular correlation functions and regular objects_ 02](/img/a0/27bf3f5146a5774eb3167a69d1e3cf.png)
[JS advanced] JS regular correlation functions and regular objects_ 02
随机推荐
[wechat applet] detailed explanation of applet host environment
Sword finger offer | number of 1 in binary
Leetcode:6127. Number of high-quality number pairs [bit operation finding rules + the sum of two numbers is greater than or equal to K + dichotomy]
Typescript learning 1 - data types
Typescript learning 2 - Interface
General test case writing specification
国债年化利率太低了,有比国债逆回购年化利率还要高的理财产品吗?
Win11动态磁贴没了?Win11中恢复动态磁贴的方法
优必选大型仿人服务机器人Walker X的核心技术突破
MySQL tutorial 68-as setting alias
MySQL 元数据锁(MDL)
进程之间的通信(管道详解)
Gap locks
报表工具的二次革命
[JS advanced] JS regular correlation functions and regular objects_ 02
权限管理-角色分配菜单
聊聊如何用 Redis 实现分布式锁?
Release of v6.5.1/2/3 series of versions of Xingyun housekeeper: the ability of database OpenAPI continues to be strengthened
The annualized interest rate of treasury bonds is too low. Is there a financial product with a higher annualized interest rate than the reverse repurchase of treasury bonds?
MySQL教程65-MySQL操作表中数据