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:
Here are some screenshots,
![[Image: pE9S6.png]](https://i.stack.imgur.com/pE9S6.png)
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 ClassHere are some screenshots,
![[Image: pE9S6.png]](https://i.stack.imgur.com/pE9S6.png)


![[Image: Capture.png]](https://i.ibb.co/z8dnqFx/Capture.png)