Help regarding thread procedure.

  • Thread starter Thread starter trialproduct2004
  • Start date Start date
T

trialproduct2004

Hi all
i am having application in c#.
i want to add thread in this application.
My problem is i don't know how to pass parameter to thread procedure.
Can someone tell me.
thanks in advance.
 
If you are using .NET 2.0 and above, you can pass a delegate of type
ParameterizedThreadStart to the Thread object, and it will call a method
that takes an object parameter.

If you are using .NET 1.1 and before, remember, the method that is run
is still a method on a class, which has access to everything that any other
method would have. That being said, you can just make sure that
fields/properties are set appropriately on the instance, and then call the
run method.

Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top