Write the sample code for threading in c# .net..
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / gby
question to Alcheringa?
So why did you define int i? ????
| Is This Answer Correct ? | 8 Yes | 5 No |
Answer / sivakumar v
Static Void Run()
{
Console.WriteLine("Thread Is Running");
}
static void Main()
{
Thread TrdObj=new Thread(Run);//create the obj
TrdObj.start();
}
| Is This Answer Correct ? | 3 Yes | 1 No |
Answer / maryada ramana
first uhave to learn c#.net then u will undertsand how much
diff is .net useless fellow Alcheringa a prentra alcherenga
kampalo putinaava
| Is This Answer Correct ? | 3 Yes | 4 No |
What is CASPOL?
FOR EXAMPLE : CLASS Dotnet { } creating object: Dotnet dn=new Dotnet(); NOW THE QUESTION IS WHICH IS CALLED AS OBJECT ?EITHER dn OR new Dotnet() and CAN YOU PROVE YOUR ANSWER?????PLEASE REPLY...
What is the value which is accepted by all data types ?
What is class in oops with example in c#?
How do you specify a custom attribute for the entire assembly?
Why is it called c sharp?
Is array reference type / value type?
What is the Difference between a sub and a function?
Define Final Class in C#
What does console writeline do?
Why do we need ienumerable in c#?
What is the difference between array and arraylist c#?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)