TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Async Component thread in C#
Karthikeyan Anbarasan
Apr 01, 2011
3.2
k
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
Async Component thread in C#.
This blog shows on how to use an Asyn Component thread in C#
using System;
using
System
.Threading;
namespace Demo
{
class Program
{
static void Main()
{
Console.WriteLine("Main thread: {0}", Thread.CurrentThread.ManagedThreadId);
AsyncComponent comp = new AsyncComponent();
comp.LongTaskCompleted += Comp_LongTaskCompleted;
comp.LongTaskAsync("Input details", 33);
Console.ReadLine();
}
static void Comp_LongTaskCompleted(object sender, LongTaskCompletedEventArgs e)
{
Console.WriteLine("completed result: {0}, thread: {1}", e.Output, Thread.CurrentThread.ManagedThreadId);
}
}
}
Async Component thread
Next Recommended Reading
Load Data Interval Basis Using Timer(Thread) In C#