Sandeep Dange
how to use parametrized function as a thread?
By Sandeep Dange in Multithreading on Apr 08 2010
  • jayant bramhankar
    Apr, 2010 10

    You can use class to hold your parameters..

    public class MyClass
    {
       private string  param;
       public MyClass (string  param)
       {
           this.param = param;
       }
       public void YourFunction()
       {
           // use param here
       }
    }            

    MyClass cObj = new MyClass (param);
    Thread t=new Thread (new ThreadStart (cObj. YourFunction)).Start();                                  

     you can also use msdn reference, good example here.
    http://msdn.microsoft.com/en-us/library/1h2f2459(v=VS.90).aspx

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS