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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:43:03+00:00 2026-06-14T05:43:03+00:00

I am multithreading with a threadpool and whenever i try to start the requests

  • 0

I am multithreading with a threadpool and whenever i try to start the requests i get

Object reference not set to an instance of an object.

on

Application.Run(new Form1());

I don’t have the same problem without the proxies tho

This is the code that causes trouble

if (ProxyBox.Text != string.Empty)
{
     lock (locker)
     {
         Random rnd = new Random();
         int rndd = rnd.Next(0, int.Parse(ProxyNumber.Text));
         request.Proxy = new WebProxy(proxysplit[rndd].ToString());
     }
}

Basicaly i want to get a random proxy from the proxysplit array everytime

Any Ideas 😕

  • 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-06-14T05:43:04+00:00Added an answer on June 14, 2026 at 5:43 am

    There are multiple questions you need to answer before we can help you:

    1. Which line is the error occurring on?
    2. Is the specified proxy initialized (i.e. not null)?
    3. Furthermore, is proxysplit initialized?

    Check what’s not initialized and you may also want to generate the random number between 0 and the number of elements in proxysplit:

    if (ProxyBox.Text != string.Empty)
    {
        lock (locker)
        {
            Random rnd = new Random();
            int rndd = rnd.Next(0, proxysplit.Length);
            request.Proxy = new WebProxy(proxysplit[rndd].ToString());
        }
    }
    

    If you use the the ProxyNumber and the resulting integer is outside the range of the proxysplit array length, then you may also get an exception while trying to access an element out of range, i.e. ArgumentOutOfRangeException.

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

Sidebar

Related Questions

Not that I'm not appreciative of the powers of multithreading or ThreadPool , but
In this multithreading program, when I run it, I always get the output in
class MultiThreading { public class ThreadClass { public string InputString { get; private set;
I'm new to multithreading and I'm working on parallelizing an area in my application.
I'm new to multithreading and try to learn it through a simple program, which
I am building a multi threading application. I have setup a threadPool. [ A
I haven't used multithreading in Clojure at all so am unsure where to start.
I just introduced multithreading into my app JUST to get a silly UIActivityIndicatorView to
In my multithreading application I am using some variables that can be altered by
Let me preface this with the disclaimer that I am very new to multithreading

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.