Questo sito utilizza cookies solo per scopi di autenticazione sul sito e nient'altro. Nessuna informazione personale viene tracciata. Leggi l'informativa sui cookies.
Username: Password: oppure
Testa Socks - Form1.vb

Form1.vb

Caricato da:
Scarica il programma completo

  1. Imports System
  2. Imports System.IO
  3. Imports System.Net
  4. Imports System.Net.Sockets
  5. Imports System.Environment
  6.  
  7. Public Class Form1
  8.  
  9.     Dim a As Integer
  10.     Dim Port As IPEndPoint
  11.     Dim Socket As Socket
  12.     Dim conta As Integer
  13.     Dim tick As Integer
  14.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  15.         OpenFileDialog1.ShowDialog()
  16.         TextBox1.Text = (OpenFileDialog1.FileName)
  17.     End Sub
  18.  
  19.     Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
  20.         ListBox1.Items.Clear()
  21.         Dim sr As StreamReader = New StreamReader(TextBox1.Text)
  22.         Try
  23.             For a = 1 To 9999999
  24.                 ListBox1.Items.Add(sr.ReadLine)
  25.             Next a
  26.         Catch b As Exception
  27.             Label1.Text = ListBox1.Items.Count
  28.         End Try
  29.     End Sub
  30.  
  31.     Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
  32.         ListBox1.SelectedIndex = 0
  33.         For a = 1 To ListBox1.Items.Count - 1
  34.             Application.DoEvents()
  35.             Try
  36.                 Dim stringa As String = ListBox1.SelectedItem
  37.                 Dim arr() As String
  38.                 Dim ip As String
  39.                 Dim porta As String
  40.                 log.Text = "In Connessione..."
  41.                 arr = Split(stringa, ":")
  42.                 ip = arr(0)
  43.                 porta = arr(1)
  44.                 Port = New IPEndPoint(IPAddress.Parse(ip), Convert.ToInt32(porta))
  45.                 Socket = New Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)
  46.                 tick = Environment.TickCount
  47.                 Socket.Connect(Port)
  48.                 log.Text = "Connesso..."
  49.                 Socket.Close()
  50.                 conta = Environment.TickCount - tick
  51.                 log.Text = "Disconnesso..."
  52.                 Label3.Text += 1
  53.                 Label12.Text = conta
  54.                 If conta < NumericUpDown1.Value Then
  55.                     ListBox2.Items.Add(ListBox1.SelectedItem)
  56.                 End If
  57.                 ListBox1.SelectedIndex = ListBox1.SelectedIndex + 1
  58.             Catch f As SocketException
  59.                 log.Text = "Socks non funzionante..."
  60.                 ListBox3.Items.Add(ListBox1.SelectedItem)
  61.                 ListBox1.SelectedIndex = ListBox1.SelectedIndex + 1
  62.                 Label4.Text += 1
  63.             End Try
  64.         Next a
  65.         MessageBox.Show("Controllo temrinato", Me.Text, MessageBoxButtons.OK, MessageBoxIcon.Information)
  66.     End Sub
  67.  
  68.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  69.         If File.Exists(Application.StartupPath & "\funzionanti.txt") = False Then
  70.             File.Create(Application.StartupPath & "\funzionanti.txt")
  71.             File.Create(Application.StartupPath & "\nonfunzionanti.txt")
  72.             MessageBox.Show("Creazione dei file completa l'applicazione verra riavviata", Me.Text, MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
  73.             Application.Restart()
  74.         End If
  75.     End Sub
  76.  
  77.     Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
  78.         Label6.Text = ListBox1.SelectedIndex + 1
  79.     End Sub
  80.  
  81.     Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
  82.         Dim sw As StreamWriter = New StreamWriter(Application.StartupPath & "\funzionanti.txt")
  83.         For a = 0 To ListBox2.Items.Count - 1
  84.             sw.WriteLine(ListBox2.Items.Item(a))
  85.         Next a
  86.         sw.Close()
  87.         Dim sw2 As StreamWriter = New StreamWriter(Application.StartupPath & "\nonfunzionanti.txt")
  88.         For a = 0 To ListBox3.Items.Count - 1
  89.             sw2.WriteLine(ListBox3.Items.Item(a))
  90.         Next a
  91.         sw2.Close()
  92.     End Sub
  93.  
  94.     Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
  95.         conta += 1
  96.     End Sub
  97. End Class