C # parameter thread

Source: Internet
Author: User

Public Form1 () {InitializeComponent ();        } Thread t; private void Button1_Click (object sender, EventArgs e) {int num = Int.            Parse (This.textBox1.Text); int num2 = Int.            Parse (This.textBox2.Text);            Duo A = new duo ();            A.NUM1 = num;            a.num2 = num2;                       t = new Thread (test);            T.isbackground = true;        T.start (a);                                    } private void Test (object num) {duo A = num as duo;            int n = 0;            while (n < 10000)//{//n++;            This.textBox1.Text = N.tostring ();            } int n = a.num1;                        int b = a.num2;                    This.label1.Text = Convert.ToString ((n + B) * B/2); private void Form1_Load (object sender, EventArgs e) {Control.checkforillegalcrossthread Calls = false;        private void Form1_formclosing (object sender, FormClosingEventArgs e) {}} 

Array public partial class Form1:form {public Form1 () {InitializeComponent ();        } Thread t; private void Button1_Click (object sender, EventArgs e) {int num = Int.            Parse (This.textBox1.Text); int num2 = Int.            Parse (This.textBox2.Text);            Int[] A = new int[] {num,num2};                       t = new Thread (test);            T.isbackground = true;        T.start (a);                                                } private void Test (object num) {int[] nums= (int[]) num;            int n = 0;            while (n < 10000)//{//n++;            This.textBox1.Text = N.tostring ();            } int n = nums[0];                        int b = nums[1];                    This.label1.Text = Convert.ToString ((n + B) * B/2); private void Form1_Load (object sender, EventArgs e) {Control.checkForillegalcrossthreadcalls = false; private void Form1_formclosing (object sender, FormClosingEventArgs e) {}}

Set public partial class Form1:form {list<int> add = new list<int> ();        Public Form1 () {InitializeComponent ();        } Thread t; private void Button1_Click (object sender, EventArgs e) {Add.            Clear (); int num = Int.            Parse (This.textBox1.Text); int num2 = Int.            Parse (This.textBox2.Text); Add.            ADD (num); Add.                        ADD (NUM2);                       t = new Thread (test);            T.isbackground = true;        T.start (add);            } private void Test (object num) {//int nums= (int) num;                                                            List<int> nums = (list<int>) num;            int n = 0;            while (n < 10000)//{//n++;            This.textBox1.Text = N.tostring ();            } int n = nums[0];                        int b = nums[1]; This.label1.                    Text = Convert.ToString ((n + B) * B/2); private void Form1_Load (object sender, EventArgs e) {Control.checkforillegalcrossthread        Calls = false; private void Form1_formclosing (object sender, FormClosingEventArgs e) {}}

  

C # parameter thread

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.