How to pass parameters to
public void download(string filename)
// download code
Thread thread = new Thread(new ThreadStart(download(filename));
error method type expected.
The simplest is just
string filename = ... Thread thread = new Thread(() => download(filename)); thread.Start();
The advantage(s) of this (over
ParameterizedThreadStart) is that you can pass multiple parameters, and you get compile-time checking without needing to cast from
object all the time.