c# thread method

前端 未结 5 1208
太阳男子
太阳男子 2020-12-10 02:02

If I have a

public void Method(int m)
{
  ...
}

how can I create a thread to this method?

Thread t = new Thread((Me

5条回答
  •  悲哀的现实
    2020-12-10 02:51

    Method needs to take an object not an int to be able to use the ParameterizedThreadStart delegate.

    So change m to an object and cast it to an int first off.

提交回复
热议问题