Public Class Form1 Dim start As String Dim koniec As String Dim numer As String Dim aktywne As Integer Dim nieaktywne As Integer Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click start = TextBox4.Text koniec = TextBox5.Text ProgressBar1.Minimum = start ProgressBar1.Maximum = koniec + 1 ProgressBar1.Value = ProgressBar1.Minimum ListBox1.Items.Clear() ListBox2.Items.Clear() If Not (IsNumeric(TextBox1.Text) And IsNumeric(TextBox2.Text) And IsNumeric(TextBox3.Text) _ And IsNumeric(TextBox4.Text) And IsNumeric(TextBox5.Text)) Then MsgBox("Aby program działał dobrze wszystkie pola muszą zawierać cyfry z przedziału od 0-255. Nie spełniłeś wymagań.") Else If TextBox1.Text <= 255 And TextBox1.Text >= 0 And TextBox2.Text <= 255 And TextBox2.Text >= 0 And _ TextBox3.Text <= 255 And TextBox3.Text >= 0 And TextBox4.Text <= 255 And TextBox4.Text >= 0 And _ TextBox5.Text <= 255 And TextBox5.Text >= 0 Then Dim output As Integer If Integer.TryParse(TextBox1.Text, output) And Integer.TryParse(TextBox2.Text, output) And _ Integer.TryParse(TextBox3.Text, output) And Integer.TryParse(TextBox4.Text, output) And _ Integer.TryParse(TextBox5.Text, output) Then Do numer = "" + TextBox1.Text + "." + TextBox2.Text + "." + TextBox3.Text + "." + start.ToString If My.Computer.Network.Ping(numer) Then ListBox1.Items.Add(numer) aktywne += 1 Else ListBox2.Items.Add(numer) nieaktywne += 1 End If If ProgressBar1.Value = koniec Then MsgBox("Operacja ukończona pomyślnie. Znaleziono " + aktywne.ToString + " aktywnych numerów IP i " _ + nieaktywne.ToString + " numerów nieaktywnych") End If start += 1 ProgressBar1.Value += 1 Loop Until start = koniec + 1 Else MsgBox("Proszę podać tylko liczby całkowite.") End If Else MsgBox("któreś z pól zawiera wartość większą niż 255.") End If End If ProgressBar1.Value = ProgressBar1.Minimum End Sub Private Sub LinkLabel1_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked Process.Start("http://visualmonsters.cba.pl") End Sub End Class