亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? frmmain.cs

?? CSharp多線程的異步調用程序例子
?? CS
字號:
//Copyright (C) 2002 Microsoft Corporation
//All rights reserved.
//THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 
//EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF 
//MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
//Requires the Trial or Release version of Visual Studio .NET Professional (or greater).


using System;
using System.Windows.Forms;
using System.Threading; // Namespace for Thread class

public class frmMain : System.Windows.Forms.Form
{

#region " Windows Form Designer generated code "

	public frmMain()
	{
		//This call is required by the Windows Form Designer.
		InitializeComponent();

		//Add any initialization after the InitializeComponent() call
		// So that we only need to set the title of the application once,
		// we use the AssemblyInfo class (defined in the AssemblyInfo.vb file)
		// to read the AssemblyTitle attribute.

		AssemblyInfo ainfo = new AssemblyInfo();

		this.Text = ainfo.Title;
		this.mnuAbout.Text = string.Format("&About {0} ...", ainfo.Title);
	}

	//Form overrides dispose to clean up the component list.
	protected override void Dispose(bool disposing)
	{
		if(disposing)
		{
			if (components != null) 
			{
				components.Dispose();
			}
		}

		base.Dispose(disposing);
	}

	//Required by the Windows Form Designer
	private System.ComponentModel.IContainer components = null;

	//NOTE: The following procedure is required by the Windows Form Designer
	//It can be modified using the Windows Form Designer.  
	//Do not modify it using the code editor.
	private System.Windows.Forms.MainMenu mnuMain;
	private System.Windows.Forms.MenuItem mnuFile;
	private System.Windows.Forms.MenuItem mnuExit;
	private System.Windows.Forms.MenuItem mnuHelp;
	private System.Windows.Forms.MenuItem mnuAbout;
	private System.Windows.Forms.GroupBox grpLongRunningTask;
    private System.Windows.Forms.Button cmdSameThread;
    private System.Windows.Forms.Button cmdWorkerPoolThread;
    private System.Windows.Forms.Button cmdRunOnnewWin32Thread;
    private System.Windows.Forms.Label lblThreadID;

	private void InitializeComponent()
	{
		System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(frmMain));

		this.mnuMain = new System.Windows.Forms.MainMenu();
		this.mnuFile = new System.Windows.Forms.MenuItem();
		this.mnuExit = new System.Windows.Forms.MenuItem();
		this.mnuHelp = new System.Windows.Forms.MenuItem();
		this.mnuAbout = new System.Windows.Forms.MenuItem();
		this.grpLongRunningTask = new System.Windows.Forms.GroupBox();
		this.cmdRunOnnewWin32Thread = new System.Windows.Forms.Button();
		this.cmdWorkerPoolThread = new System.Windows.Forms.Button();
		this.cmdSameThread = new System.Windows.Forms.Button();
		this.lblThreadID = new System.Windows.Forms.Label();
		this.grpLongRunningTask.SuspendLayout();
		this.SuspendLayout();

		//
		//mnuMain
		//
		this.mnuMain.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.mnuFile, this.mnuHelp});
		//
		//mnuFile
		//
		this.mnuFile.Index = 0;
		this.mnuFile.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {this.mnuExit});
		this.mnuFile.Text = "&File";
		//
		//mnuExit
		//
		this.mnuExit.Index = 0;
		this.mnuExit.Text = "E&xit";
		this.mnuExit.Click += new System.EventHandler(this.mnuExit_Click);
		//
		//mnuHelp
		//
		this.mnuHelp.Index = 1;
		this.mnuHelp.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {this.mnuAbout});
		this.mnuHelp.Text = "&Help";
		//
		//mnuAbout
		//
		this.mnuAbout.Index = 0;
		this.mnuAbout.Text = "Text Comes from AssemblyInfo";
		this.mnuAbout.Click += new System.EventHandler(this.mnuAbout_Click);
		//
		//grpLongRunningTask
		//
		this.grpLongRunningTask.Controls.AddRange(new System.Windows.Forms.Control[] {this.cmdRunOnnewWin32Thread, this.cmdWorkerPoolThread, this.cmdSameThread});
		this.grpLongRunningTask.Location = new System.Drawing.Point(16, 56);
		this.grpLongRunningTask.Name = "grpLongRunningTask";
		this.grpLongRunningTask.Size = new System.Drawing.Size(232, 144);
		this.grpLongRunningTask.TabIndex = 3;
		this.grpLongRunningTask.TabStop = false;
		this.grpLongRunningTask.Text = "Execute a long-running task";
		//
		//cmdRunOnnewWin32Thread
		//
		this.cmdRunOnnewWin32Thread.ImeMode = System.Windows.Forms.ImeMode.NoControl;
		this.cmdRunOnnewWin32Thread.Location = new System.Drawing.Point(16, 96);
		this.cmdRunOnnewWin32Thread.Name = "cmdRunOnnewWin32Thread";
		this.cmdRunOnnewWin32Thread.Size = new System.Drawing.Size(200, 23);
		this.cmdRunOnnewWin32Thread.TabIndex = 5;
		this.cmdRunOnnewWin32Thread.Text = "Run on &new Win32 thread";
		this.cmdRunOnnewWin32Thread.Click += new System.EventHandler(this.cmdRunOnNewWin32Thread_Click);
		//
		//cmdWorkerPoolThread
		//
		this.cmdWorkerPoolThread.ImeMode = System.Windows.Forms.ImeMode.NoControl;
		this.cmdWorkerPoolThread.Location = new System.Drawing.Point(16, 64);
		this.cmdWorkerPoolThread.Name = "cmdWorkerPoolThread";
		this.cmdWorkerPoolThread.Size = new System.Drawing.Size(200, 23);
		this.cmdWorkerPoolThread.TabIndex = 4;
		this.cmdWorkerPoolThread.Text = "Run on &worker pool thread";
		this.cmdWorkerPoolThread.Click += new System.EventHandler(this.cmdWorkerPoolThread_Click);
		//
		//cmdSameThread
		//
		this.cmdSameThread.ImeMode = System.Windows.Forms.ImeMode.NoControl;
		this.cmdSameThread.Location = new System.Drawing.Point(16, 32);
		this.cmdSameThread.Name = "cmdSameThread";
		this.cmdSameThread.Size = new System.Drawing.Size(200, 23);
		this.cmdSameThread.TabIndex = 3;
		this.cmdSameThread.Text = "Run on &same thread";
		this.cmdSameThread.Click += new System.EventHandler(this.cmdSameThread_Click);
		//
		//lblThreadID
		//
		this.lblThreadID.ImeMode = System.Windows.Forms.ImeMode.NoControl;
		this.lblThreadID.Location = new System.Drawing.Point(16, 16);
		this.lblThreadID.Name = "lblThreadID";
		this.lblThreadID.Size = new System.Drawing.Size(240, 24);
		this.lblThreadID.TabIndex = 4;
		this.lblThreadID.Text = "This window is being serviced by thread: ";
		//
		//frmMain
		//
		this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
		this.ClientSize = new System.Drawing.Size(266, 235);
		this.Controls.AddRange(new System.Windows.Forms.Control[] {this.lblThreadID, this.grpLongRunningTask});
		this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
		this.Icon = (System.Drawing.Icon) resources.GetObject("$this.Icon");
		this.MaximizeBox = false;
		this.Menu = this.mnuMain;
		this.Name = "frmMain";
		this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
		this.Text = "Title Comes from Assembly Info";
		this.grpLongRunningTask.ResumeLayout(false);
		this.ResumeLayout(false);
		this.Load += new EventHandler(this.frmMain_Load);
	}
#endregion

	/// <summary>
	/// The main entry point for the application.
	/// </summary>
	[STAThread]
	static void Main() 
	{
		Application.Run(new frmMain());
	}

#region " Standard Menu Code "
	// <System.Diagnostics.DebuggerStepThrough()> has been added to some procedures since they are
	// not the focus of the demo. Remove them if you wish to debug the procedures.
	// This code simply shows the About form.

	private void mnuAbout_Click(object sender, System.EventArgs e)
	{
		// Open the About form in Dialog Mode
		frmAbout frm = new frmAbout();

		frm.ShowDialog(this);
		frm.Dispose();
	}

	// This code will close the form.
	private void mnuExit_Click(object sender, System.EventArgs e)
	{
		// Close the current form
		this.Close();
	}

#endregion

    private void frmMain_Load(object sender, System.EventArgs e)
	{
        //Display the main thread for the application 
        lblThreadID.Text += AppDomain.GetCurrentThreadId().ToString();
    }

    private void cmdSameThread_Click(object sender, System.EventArgs e)
	{
        //Run the task on the same thread that is managing the frmMain window.
		TheLongRunningTask();
    }

    //To run the task on a worker pool thread, you can use an asynchronous
    //invocation on a delegate. For this example, we'll declare a delegate
    //named TaskDelegate, and call it asynchronously. The signature of the
    //delegate declaration must match the method (TheLongRunningTask) exactly.
    delegate void TaskDelegate();

    private void cmdWorkerPoolThread_Click(object sender, System.EventArgs e)
	{
        //To run the task an a thread from the worker pool, create an instance
        //of a delegate whose signature matches the method that will be called,
        //then call BeginInvoke on that delegate. For this example, the arguments
        //and return value of BeginInvoke are unneeded. This technique is sometimes
        //referred to as "Fire and Forget".

        TaskDelegate td = new TaskDelegate(new ThreadStart(TheLongRunningTask));
        td.BeginInvoke(null, null); // Runs on a worker thread from the pool
    }

    private void cmdRunOnNewWin32Thread_Click(object sender, System.EventArgs e)
	{
        //To run the task on a newly created OS thread (rather than a tread from the
        //thread pool), create a new instance of a managed thread. The constructor 
        //takes the address of a subroutine with no arguments.
        Thread t = new Thread(new ThreadStart(TheLongRunningTask));  // Creates the new thread
        t.Start(); // Begins the execution of the new thread
    }

    private void TheLongRunningTask()
	{
        //This method simulates some long-running task. To represent the work in 
        //progress, a form with a progress bar will display during its execution.
        //The method displays the form, then updates the progress bar every half
        //second for 5 seconds. After simulating the task, the form is taken down.

		frmTaskProgress f = new frmTaskProgress();

		f.Show();
		f.Refresh();	   // Refresh causes an instant (non-posted) display of the label.

        //Slowly increment the progress bar
        int i;

        for(i = 1; i < 10; i++)
		{
            f.prgTaskProgress.Value += 10;
			Thread.Sleep(500); // half-second delay
		}

        //Remove the form after the "task" finishes
		f.Hide();
		f.Dispose();
	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
五月激情丁香一区二区三区| 国产乱对白刺激视频不卡| 精品一区二区影视| 95精品视频在线| 久久综合色一综合色88| 一卡二卡欧美日韩| 暴力调教一区二区三区| 日韩欧美一级二级三级久久久| 亚洲美女屁股眼交3| 国产一区二区免费看| 在线播放日韩导航| 亚洲精品videosex极品| 9人人澡人人爽人人精品| 久久精品男人的天堂| 秋霞国产午夜精品免费视频| 色狠狠色噜噜噜综合网| 国产精品久久久久久久蜜臀| 国产一区二区三区| 精品国产青草久久久久福利| 午夜精品福利视频网站| 色94色欧美sute亚洲线路一久| 欧美国产97人人爽人人喊| 久久99精品国产麻豆婷婷洗澡| 欧美精品成人一区二区三区四区| 一区二区三区欧美久久| 一本大道av一区二区在线播放| 国产亚洲欧洲997久久综合| 久久电影国产免费久久电影| 欧美一区日韩一区| 日本不卡1234视频| 日韩一区二区三区三四区视频在线观看 | 欧美日韩在线播放一区| 亚洲精品日产精品乱码不卡| 日本久久一区二区三区| 亚洲品质自拍视频网站| 91在线免费视频观看| 中文字幕在线一区免费| 91小宝寻花一区二区三区| 中文字幕一区视频| 91美女视频网站| 一区二区三区久久久| 欧美日韩视频在线一区二区| 三级影片在线观看欧美日韩一区二区| 欧美日韩一区高清| 麻豆视频观看网址久久| 国产亚洲一二三区| 99精品国产91久久久久久| 亚洲欧美日韩中文字幕一区二区三区 | 天堂久久久久va久久久久| 9191久久久久久久久久久| 日韩国产精品久久久| 日韩亚洲欧美一区二区三区| 国产伦精品一区二区三区免费迷| 久久久久一区二区三区四区| 91在线无精精品入口| 亚洲一区二区三区美女| 欧美成人一区二区三区在线观看| 黄色日韩网站视频| 亚洲欧洲精品一区二区三区不卡| 欧美亚洲国产一区二区三区| 日韩高清一区在线| 久久美女高清视频| 在线亚洲免费视频| 精品一区二区三区不卡| 国产精品每日更新在线播放网址| 色综合久久久久久久久久久| 午夜电影网一区| 国产女人水真多18毛片18精品视频 | 一区二区三区在线视频观看 | 日产国产欧美视频一区精品| 国产丝袜在线精品| 欧美日韩一区视频| 国产福利一区二区| 亚洲bdsm女犯bdsm网站| 国产日韩欧美一区二区三区乱码| 欧美这里有精品| 国产成人精品亚洲午夜麻豆| 午夜视频久久久久久| 中文字幕第一区二区| 8v天堂国产在线一区二区| 成人黄色小视频在线观看| 日韩成人免费在线| 中文字幕色av一区二区三区| 精品国产麻豆免费人成网站| 色婷婷精品久久二区二区蜜臀av| 国产精品综合在线视频| 日本亚洲免费观看| 亚洲人成电影网站色mp4| 久久精品亚洲一区二区三区浴池| 欧洲日韩一区二区三区| 国产成a人亚洲| 激情五月婷婷综合| 午夜在线电影亚洲一区| 亚洲欧美一区二区三区国产精品| 久久亚洲一区二区三区明星换脸| 91超碰这里只有精品国产| 色婷婷av一区二区三区gif | 免费精品视频最新在线| 亚洲乱码中文字幕综合| 国产欧美日韩另类视频免费观看| 日韩欧美一区二区视频| 欧美丰满嫩嫩电影| 欧美精品第1页| 欧美日韩国产成人在线91| 日本精品一区二区三区高清| 99久久亚洲一区二区三区青草| 国产精品亚洲人在线观看| 激情五月婷婷综合网| 琪琪久久久久日韩精品| 日韩二区三区在线观看| 五月天欧美精品| 午夜精品一区二区三区电影天堂 | 另类综合日韩欧美亚洲| 日韩一区精品字幕| 首页国产丝袜综合| 日本欧美一区二区三区乱码| 日韩精品一级二级| 日韩不卡一区二区| 免费国产亚洲视频| 精品一区二区在线看| 国产一区二区三区在线观看精品 | 日韩福利视频网| 麻豆成人av在线| 国产一区二区影院| 成人黄色电影在线| 色欲综合视频天天天| 色老头久久综合| 欧美男生操女生| 亚洲精品在线三区| 国产日韩欧美亚洲| 亚洲精品日韩一| 日韩**一区毛片| 国产一区二区女| 91小视频在线免费看| 欧美日韩久久不卡| 精品成人一区二区| 亚洲欧美在线观看| 一区二区三区国产豹纹内裤在线| 性欧美大战久久久久久久久| 美女性感视频久久| 成人免费va视频| 欧美性受xxxx黑人xyx性爽| 欧美美女bb生活片| 久久这里只有精品视频网| 欧美国产日韩在线观看| 亚洲午夜精品在线| 国产精品自在欧美一区| 99免费精品视频| 51精品国自产在线| 国产精品你懂的| 天天综合网天天综合色| 福利一区二区在线观看| 欧美色图天堂网| 国产日本亚洲高清| 午夜精品久久久久影视| 国产伦精一区二区三区| 欧美视频精品在线观看| 久久久91精品国产一区二区三区| 亚洲线精品一区二区三区| 国产精品综合网| 6080yy午夜一二三区久久| 国产精品久久久久久久蜜臀 | 国产成人免费网站| 欧美在线高清视频| 国产亚洲综合在线| 日本在线不卡一区| 91小视频在线观看| 国产婷婷色一区二区三区| 亚洲h动漫在线| 色欧美日韩亚洲| 欧美国产日韩亚洲一区| 免费xxxx性欧美18vr| 欧美亚洲国产一区在线观看网站| 久久久亚洲精品一区二区三区| 亚洲福利视频一区二区| www.欧美精品一二区| 精品99一区二区| 日韩成人伦理电影在线观看| 91蜜桃婷婷狠狠久久综合9色| 26uuu亚洲| 日韩av一级电影| 在线不卡中文字幕| 亚洲靠逼com| www.在线成人| 国产欧美日韩精品a在线观看| 狠狠久久亚洲欧美| 日韩一区二区三区电影在线观看| 亚洲成人动漫av| 欧美在线制服丝袜| 亚洲精品乱码久久久久久| 不卡免费追剧大全电视剧网站| 欧美大片在线观看| 久久精品999| 久久久久久久久蜜桃| 国产制服丝袜一区| 久久久噜噜噜久噜久久综合| 国产一区二区91| 337p粉嫩大胆色噜噜噜噜亚洲 | 亚洲综合久久av| 欧美影视一区在线|