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 6952405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:20:43+00:00 2026-05-27T14:20:43+00:00

I get a connection list sometime 70 people in the list sometime 1000 ,

  • 0

I get a connection list sometime 70 people in the list sometime 1000 , i put a loop on it and start getting them one by one using HTTPWEBREQUEST, and i have a textbox that keeps showing me where i am at , 10-15 or 200 etc,,

My problem is i have a stop button on this, and when i press stop button i want it to break out of it, how can i achieve that?

I am not clear what to do when i press stop? Because the form(its a windows form application) gets stuck/hanged until it is completed…

Any help is appreciated ,
Thank you in advance.

  • 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-27T14:20:43+00:00Added an answer on May 27, 2026 at 2:20 pm

    It sounds like you’re doing all the work in the UI thread. Instead, you should either use asynchronous web requests (possibly using WebClient) or do the downloading in a worker thread (e.g. using BackgroundWorker). That way your UI will stay responsive, and you can have some sort of shared flag to indicate whether or not you should keep processing the list. Note that you’ll want to either use volatile, locking, or the Interlocked class to make sure that changes made to the shared flag in the UI thread are visible in the worker thread.

    Another alternative is to use the Task Parallel Library (TPL) from .NET 4, with a cancellation token. That’s a bit more advanced, but would be cleaner in the long run.

    Note that C# 5 will make asynchrony significantly easier.

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

Sidebar

Related Questions

how to get network connection list in my computer with c# vpn list or
when i use connection.queries in django i get a weird exception: 'list' object is
I have a collection like this List<int> {1,15,17,8,3}; how to get a flat string
How can I get the connection.connection_string value from the following hibernate xml file using
I'm using Fluent NHibernate and need to get my Connection String from the connection.connection_string
I'm using ftplib for connecting and getting file list from FTP server. The problem
I have a nested loop structure in my code. Sometimes, I get the below
I have this problem.. I'm receiving data from a client..Using a socket connection. But
I would like to get collection or list of Item objects, but I get
I am trying to get data for my collection_select list. Details There are 4

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.