Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Async Component thread in C#
WhatsApp
Karthikeyan Anbarasan
13y
3.3
k
0
0
25
Blog
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
Up Next
Load Data Interval Basis Using Timer(Thread) In C#
Ebook Download
View all
DateTime in C#
Read by 1.3k people
Download Now!
Learn
View all
Membership not found