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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T15:18:33+00:00 2026-05-31T15:18:33+00:00

i have Winform application who run all the files within listbox, i am using

  • 0

i have Winform application who run all the files within listbox,
i am using Pcapdotnet DLLs to send packets into my network adapter, the process is that i am taking Wireshark capture file and with this file send all the packets.
each file will run with BackgroundWorker and after it’s finished the next time in my listbox srart to run etc.
i added a Checkbox and when this Checkbox in checked state all the files run in the same time simultaneous.
when it’s running my application crash with error: Exception has been thrown by the target of an invocation in:

static void Main()
{
    Adapters addr = new Adapters();
    Application.EnableVisualStyles();
    Application.SetCompatibleTextRenderingDefault(false);
    Application.Run(new mainWindow());
}

the error received in the last line (Application.Run(new mainWindow());)

this is my code who handle in simultaneous running:

        for (int i = 0; i < listBoxFiles.Items.Count; i++)
        {
            string filePath  = (string)listBoxFiles.Items[i];
            playCount = 0;

            BackgroundWorker bgWsim = new BackgroundWorker();
            bgWsim.WorkerReportsProgress = true;
            bgWsim.ProgressChanged += new ProgressChangedEventHandler(bgW_ProgressChanged);
            bgWsim.DoWork += new DoWorkEventHandler(
            (s3, e3) =>
            {
                while ((playCount < numberOfLoops) && (bContinuePlay)) //play the capture
                {
                    for (int k = 0; (k < listBoxFiles.Items.Count) && (bContinuePlay); k++)
                    {
                        class = new myClass(filePath , playSpeed);

                        class.evePacketProgress += new class.dlgPacketProgress(
                            (progressCount) =>
                            {
                                bgWsim.ReportProgress(progressCount, class);
                            });

                        if (selectedAdapter != null)
                        {
                            bContinuePlay = class.playCapture(selectedAdapter._packetDevice);
                        }

                        playCount++;
                        Thread.Sleep((int)delay);
                    }
                }
            });

            bgWsim.RunWorkerCompleted += new RunWorkerCompletedEventHandler(
            (s3, e3) =>
            {
                groupBoxSelect.Enabled = true;
                groupBoxOptions.Enabled = true;
                groupBoxInfo.Enabled = true;
                btnPlay.Enabled = true;
            }
            );

            bgWsim.RunWorkerAsync();
        }

how can i debug this error and find the problem ?

error screenshot:

http://i42.tinypic.com/2ainbqp.jpg

  • 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-31T15:18:34+00:00Added an answer on May 31, 2026 at 3:18 pm

    A ProgressBar has Maximum and Minumum properties that are used to define the range of values that it will accept (defaulting from 0 to 100). If you try to set the Value property to a number outside of the range, it, will throw an ArgumentException. See here.

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

Sidebar

Related Questions

I have my winform application gathering data using databinding. Everything looks fine except that
I have an application (winform exe) that I run several times. Does this mean
I am using C# and developing a winform application. I have a project class
I have a WinForm application which is generating CSV files. I give the user
I have a winform application and this winform application has created few files. I
I have one winform application. I can get HTML of page using webclient call
I have a winform application that goes with name myForm . Within this form
I have c# winform application. I want to print all form objects, labels,textboxes etc..
I have a Winform application built with C# and .Net 2.0. I have a
I have a winform application that uses some referenced web services to get data.

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.