国产探花免费观看_亚洲丰满少妇自慰呻吟_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命令

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 八宿县| 大冶市| 兰溪市| 涟源市| 龙岩市| 青田县| 浠水县| 新丰县| 深水埗区| 迭部县| 昔阳县| 家居| 福鼎市| 建平县| 敖汉旗| 瓦房店市| 鹤壁市| 仙游县| 永寿县| 光泽县| 石泉县| 郧西县| 盐亭县| 无极县| 监利县| 治县。| 格尔木市| 秦皇岛市| 台中县| 来凤县| 上思县| 基隆市| 八宿县| 蕉岭县| 兴化市| 莎车县| 汝南县| 同仁县| 鄂伦春自治旗| 开封县| 扶绥县|