Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running a method with parameters in a thread in c#

Tags:

c#

I am currently working on a project in C#. I have a method called updateProgress() which has two int parameters (count and totalRows).

If I have call the method by saying updateProgress(count, totalRows) this works fine but I want to run this method within a new thread.

How can I go about doing this, I have looked online and everything looks overly complicated for what I am wanting to do.

Thanks for your help with this

like image 905
Boardy Avatar asked Nov 14 '10 17:11

Boardy


1 Answers

Something like this:

new Thread(delegate () {
    updateProgress(count, totalRows);
}).Start();
like image 199
cdhowie Avatar answered Oct 13 '22 01:10

cdhowie