This article is a mirror article of machine translation, please click here to jump to the original article.

View: 18202|Reply: 0

[Communication] VB.net How do I use multi-threaded scanning?

[Copy link]
Posted on 2019-10-30 17:20:14 | | | |
  As shown in the figure, after importing the URL, you want to use multi-threading scanning. I haven't found a code that can be implemented online. Please advise.


   Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        ListBox2.Items.Clear()
        Scan_Flag = 1
        Scan_Index = 0
        Scan_Max = ListBox1.Items.Count
        ProgressBar1.Minimum = 0
        ProgressBar1.Maximum = Scan_Max
        ProgressBar1.Value = 0
        For x As Int32 = 1 To Val(ComboBox1.Text) ' combobox1.text is the number of threads
            Dim go As New Threading.Thread(AddressOf scan)
            go. Start()
        Next
        Timer1.Start()

    End Sub



   Sub scan()
        Dim index, max As Int32
        max = ListBox1.Items.Count
        For i As Int32 = 0 To ListBox1.Items.Count - 1
            If Scan_Flag = 0 Then Exit For
            Dim url As String = ListBox1.Items.Item(i) & "/index.php"
            index = Threading.Interlocked.Increment(Scan_JD)



            Dim temp As String = Scanurl(url)

                ListBox2.Items.Add(url & "--" & temp)
                Label1.Text = "scaning " & url

        Next
        Label1.Text = "scan over"
    End Sub


How can I do multi-threaded and synchronous scanning? How should the sentence be written correctly?




Previous:[Chinese Mahjong: The World's Earliest Blockchain Project]
Next:Boolean Education 2018 PHP Development Learning Video Tutorial
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com