Write the sample code for threading in c# .net..
Answer Posted / alcheringa
using system.threading;
// this is the function that we want to invoke in a new
thread
static void doit()
{
for (int i=0 ; i < 10; i++)
{
console.writeline("doing somethin");
}
}
// this is the main fucntion
public static void main()
{
// threadstart is the delegate
// we need to pass the method, ts accept's method name as
the parameter
threadstart ts=new threadstart(doit);
// this is how we define a new thread
thread tr=new thread(ts);
// we invoke the thread
tr.start()
conosle.readline();
}
Is This Answer Correct ? | 22 Yes | 10 No |
Post New Answer View All Answers
HOW to Develope the CRUD(create,read,update,delete) FORM IN WINDOWS form by using c# only
What are Indexers in C#?
What is .cshtml file?
What is the example of predicate?
Explain the difference between Metadata and Manifest
What is code verification?
What do u mean by delegation?
What is sqladapter c#?
What do you mean by streamreader/streamwriter class in c#?
What is a .aspx file?
What is ispostback c#?
What is the difference between namespace and class?
For methods inside the interface why can’t you specify the accessibility modifier?
What is reflection c#?
I need code to connect ohter systems in the LAN and i want to display my website image over there and i want explain as a admin through phone. So i need code to access other system using C-Sharp. Any one please help me.Please give me the code. Advace thanks.