Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

label error in Visual Studio when making a proxy checker

I'm new to VB and GUI development in general. I coded a proxy checker. Although the program works, I am getting the following issue with the "Remaining" label and when I try to save, The program does not set the file to be a .txt.

Here is the code:

Code
Imports System.IO

Imports System.Text
Imports System.Net

Public Class Form1
   Dim good, bad, remaining, loaded As Integer

   Private Sub loadbox_TextChanged(sender As Object, e As EventArgs) Handles loadbox.TextChanged
       loadedlabel.Text = "Loaded : " & loadbox.Lines.Count.ToString
       loaded = loadbox.Lines.Count
   End Sub

   Private Sub clearb_Click(sender As Object, e As EventArgs) Handles clearb.Click
       loadbox.Text = ""
       goodbox.Text = ""

       remaininglabel.Text = "Remaining : 0"
       loadedlabel.Text = "Loaded : 0"
       goodlabel.Text = "Good : 0"
   End Sub

   Private Sub saveb_Click(sender As Object, e As EventArgs) Handles saveb.Click
       If SaveFileDialog1.ShowDialog = DialogResult.OK Then
           System.IO.File.WriteAllText(SaveFileDialog1.FileName, goodbox.Text)
       End If
   End Sub

   Private Sub SaveFileDialog1_FileOk(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles SaveFileDialog1.FileOk

   End Sub

   Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
       Control.CheckForIllegalCrossThreadCalls = False
   End Sub

   Private Sub Button1_Click(sender As Object, e As EventArgs) Handles startb.Click
       BackgroundWorker1.RunWorkerAsync()
   End Sub

   Private Sub BackgroundWorker1_DoWork(sender As Object, e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork
       For Each line As String In loadbox.Text.Split(vbCrLf)
           line = line.Replace(vbCr, "").Replace(vbLf, "")
           Try
               Dim ademproxy As WebProxy
               ademproxy = New WebProxy(line)
               Dim request As HttpWebRequest = HttpWebRequest.Create("https://www.google.com")
               request.Proxy = ademproxy
               request.Timeout = 8000
               Dim response As HttpWebResponse = request.GetResponse

               good += 1
               goodbox.Text += line & vbNewLine
               goodlabel.Text = "Good : " & goodbox.Lines.Count - 1


           Catch ex As Exception
               Bad += 1


           End Try
           remaining = loaded - (good + bad)
           remaininglabel.Text = "Remaining : " & remaininglabel.ToString


       Next
       MsgBox("Finished :D | Found :" & good.ToString & "proxies.")
   End Sub
End Class

Here are some screenshots,
[Image: pE9S6.png]

[Image: Captsure.png]
Hi, have your code running

[Image: Capture.png]

Lines 24-26 should be
Code
SaveFileDialog1.Filter = "Text Files|*.txt"
        If SaveFileDialog1.ShowDialog() = DialogResult.OK Then
            System.IO.File.WriteAllText(SaveFileDialog1.FileName, goodbox.Text)
        End If

Line 64 should be
Code
remaininglabel.Text = "Remaining : " & remaining.ToString()

With that your app is mostly working. Consider adding multithreading because its slow ;)


Possibly Related Threads...
Thread / Author Replies Views Last Post
by brokenheartsJun 30, 2025 01:05 AM 29 1,078 Jun 30, 2025 01:05 AM
Last Post: HOMODIN
[Tutorial] by WhiteTVFeb 17, 2025 08:25 AM 0 112 Feb 17, 2025 08:25 AM
Last Post: WhiteTV
by HackersDec 11, 2024 05:11 PM 21 524 Dec 11, 2024 05:11 PM
Last Post: padrino