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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:36:11+00:00 2026-05-13T08:36:11+00:00

Hi guys just wondering if somebody could help me try and correctly thread my

  • 0

Hi guys just wondering if somebody could help me try and correctly thread my application, I am constantly hitting an hurdle after another, I have never been to clued up on threading in applications. I have tryed following this http://www.developerfusion.com/code/4654/asynchronous-httpwebrequest/ tutorial.

basically I’m just trying to stop my request from hanging my application

public class Twitter
{
    private const string _username = "****",
        _password = "****";

    private WebResponse webResp;

    public string getTimeLine()
    {
        Thread thread = new Thread(new ThreadStart(TwitterRequestTimeLine));
        thread.IsBackground = true;
        thread.Start();

        using (Stream responseStream = webResp.GetResponseStream())
        {
            //
            using (StreamReader reader = new StreamReader(responseStream))
            {
                return reader.ReadToEnd();
            }
        }
    }

    private void TwitterRequestTimeLine()
    {
        string aUrl = "http://168.143.162.116/statuses/home_timeline.xml";
        HttpWebRequest request = (HttpWebRequest) HttpWebRequest.Create(aUrl);
        SetRequestParams(request);  
        request.Credentials = new NetworkCredential(_username, _password);
        //WebResponse tempResp = request.GetResponse();
        ThreadState state = new ThreadState();
        IAsyncResult result = request.BeginGetResponse(new AsyncCallback(???), ???);

    }



      private static void SetRequestParams( HttpWebRequest request )
  {
      request.Timeout = 500000;
      request.Method = "POST";
      request.ContentType = "application/x-www-form-urlencoded";
      request.UserAgent = "AdverTwitment";
  }
}
}

anyone help would be greatly appricated

  • 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-13T08:36:11+00:00Added an answer on May 13, 2026 at 8:36 am

    If this is a WinForms app, the easiest way to keep the GUI responsive while executing the WebRequest is to use a BackgroundWorker component. Drop a BackgroundWorker on your form and call its RunWorkAsync() method. Put the code to execute the WebRequest and read the Response in the DoWork event handler.

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

Sidebar

Related Questions

Hi Guys just wondering if you could help, I have a page in C#
Just wondering which Xcode syntax colouring 'theme' all you guys use, and why??
I was just wondering if Android had built in code so that I could
Just wondering what tips or tricks you guys might have to share. As always
Hey guys I'm using python and I was just wondering how we can make
Hey guys. Just wondering if anyone knows of a method to create sparkline graphs
Hey guys, just wondering if their is a simple way to create an Item
Hi guys im just new with asp classic and jquery and am just wondering
Hi guys I was just wondering what (i, val) means in this function and
Hey guys - I'm stuck with this problem and im just wondering what the

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.