国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

C#/.net學習-13-一個多線程的搖獎winform小程序

2019-11-09 20:19:04
字體:
來源:轉載
供稿:網友
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Threading;using System.Threading.Tasks;using System.Windows.Forms;namespace _05_搖獎機應用程序{    public partial class Form1 : Form    {        public Form1()        {            InitializeComponent();        }        bool b = false;        PRivate void button1_Click(object sender, EventArgs e)        {            if (b == false)            {                b = true;                button1.Text = "停止";                Thread th = new Thread(PlayGame);                th.IsBackground = true;                th.Name = "新線程";               // th.                th.Start();            }            else//b==true            {                b = false;                button1.Text = "開始";            }            //PlayGame();        }        private void PlayGame()        {            Random r = new Random();            while (b)            {                label1.Text = r.Next(0, 10).ToString();                label2.Text = r.Next(0, 10).ToString();                label3.Text = r.Next(0, 10).ToString();            }        }        private void Form1_Load(object sender, EventArgs e)        {            Control.CheckForIllegalCrossThreadCalls = false;        }    }}
上一篇:113. Path Sum II

下一篇:Linux strace命令

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 清水县| 新丰县| 大庆市| 襄樊市| 泽普县| 雅安市| 久治县| 犍为县| 呼玛县| 怀来县| 呼和浩特市| 清原| 遂宁市| 鸡泽县| 新营市| 穆棱市| 禄丰县| 新乡县| 扶沟县| 卢湾区| 唐海县| 和田市| 永定县| 互助| 潮州市| 宣化县| 咸宁市| 静宁县| 卓资县| 古丈县| 百色市| 香格里拉县| 新巴尔虎右旗| 同仁县| 丁青县| 大城县| 额尔古纳市| 江源县| 莱芜市| 广州市| 白河县|