Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3230838
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T16:58:27+00:00 2026-05-17T16:58:27+00:00

.NET 4 has a Class – Task . It’s pretty interesting and I would

  • 0

.NET 4 has a Class – Task.
It’s pretty interesting and I would like to start using it. For example, I would like to create a very simple Task-based files downloader, with the ability to cancel with every download.
Can anyone introduce me to some sample code of doing that? I would like to have an list of running tasks and would like to be able to cancel any of them.

P.S. Code sample can be not functioning I just want to know how to use these things in a best way.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T16:58:27+00:00Added an answer on May 17, 2026 at 4:58 pm

    If you want to be able to cancel one or more tasks, you need to create a CancellationTokenSource and pass in the CancellationToken of this to each Task. If all the Tasks must be cancelled using the same operation, they can share the same token. If each task can be cancelled independently of the other, you need to have separate CancellationTokens. Please check this guide for examples of how to cancel parallel tasks.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

.NET 4 has a new FrameworkName class. An example of this being used is
1) .NET Assembly MyAssembly.dll implements a Singleton class MyClass 2) A .NET APP has
I have the following class of Schedule and using .Net Framework 4.0 . this
Mootools Ajax class has a onComplete parameter whereby you can pass a function name
I have a Solution that has two class libraries. I'm trying to convert the
The short question: Does Castle Windsor have something similar to Spring.Net's Lookup Method Injection
I am playing around again with ASP.NET, and tried to set a cookie in
I have DataTable which feeds a dropdown list. The values of this dropdown persist
Greetings! I've been fooling around (a bit) with C# and its assemblies. And so

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.