How to pass multiple parameters to a thread in C#

Let’s see how we can pass multiple parameters to a Thread in C#.

Code:

private void someMethod()
{
..
    Thread myThread =
	new Thread(
	unused => myMethod(parameter1, parameter2)
	);
    myThread.Start();
..
}
private void myMethod(String parameter1, int parameter2)
{
..
}
Categories: C# Tags: , , , , ,
%d bloggers like this: