This is evolution of pingerica which i made couple month ago, simple ping application this time pinging multiple addresses. By entering IP address into text boxes and clicking on "Start ping" button
in the labels appears ping return info.
in the labels appears ping return info.
SOURCE CODE:
Imports System.Net
Imports System.Net.NetworkInformation
Imports System.Threading
Public Class Form1
Dim ping As New Ping
Dim rp(5) As PingReply
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub BackgroundWorker1_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork
Thread.Sleep(TextBox7.Text)
'refresh rate
rp(0) = ping.Send(TextBox1.Text) ' vrednost iz textboxa1
rp(1) = ping.Send(TextBox2.Text)
rp(2) = ping.Send(TextBox3.Text)
rp(3) = ping.Send(TextBox4.Text)
rp(4) = ping.Send(TextBox5.Text)
rp(5) = ping.Send(TextBox6.Text)
rp(5) = ping.Send("192.168.1.1") ' fixna ip kao referenca
End Sub
Private Sub BackgroundWorker1_RunWorkerCompleted(ByVal sender As Object, ByVal e As System.ComponentModel.RunWorkerCompletedEventArgs) Handles BackgroundWorker1.RunWorkerCompleted
Label1.Text = "Time : " & rp(0).RoundtripTime & " ms"
Label2.Text = "Time : " & rp(1).RoundtripTime & " ms"
Label3.Text = "Time : " & rp(2).RoundtripTime & " ms"
Label4.Text = "Time : " & rp(3).RoundtripTime & " ms"
Label5.Text = "Time : " & rp(4).RoundtripTime & " ms"
Label6.Text = "Time : " & rp(5).RoundtripTime & " ms"
Label8.Text = "Time : " & rp(5).RoundtripTime & " ms"
BackgroundWorker1.RunWorkerAsync()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
BackgroundWorker1.RunWorkerAsync()
End Sub
End Class
Imports System.Net.NetworkInformation
Imports System.Threading
Public Class Form1
Dim ping As New Ping
Dim rp(5) As PingReply
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub BackgroundWorker1_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork
Thread.Sleep(TextBox7.Text)
'refresh rate
rp(0) = ping.Send(TextBox1.Text) ' vrednost iz textboxa1
rp(1) = ping.Send(TextBox2.Text)
rp(2) = ping.Send(TextBox3.Text)
rp(3) = ping.Send(TextBox4.Text)
rp(4) = ping.Send(TextBox5.Text)
rp(5) = ping.Send(TextBox6.Text)
rp(5) = ping.Send("192.168.1.1") ' fixna ip kao referenca
End Sub
Private Sub BackgroundWorker1_RunWorkerCompleted(ByVal sender As Object, ByVal e As System.ComponentModel.RunWorkerCompletedEventArgs) Handles BackgroundWorker1.RunWorkerCompleted
Label1.Text = "Time : " & rp(0).RoundtripTime & " ms"
Label2.Text = "Time : " & rp(1).RoundtripTime & " ms"
Label3.Text = "Time : " & rp(2).RoundtripTime & " ms"
Label4.Text = "Time : " & rp(3).RoundtripTime & " ms"
Label5.Text = "Time : " & rp(4).RoundtripTime & " ms"
Label6.Text = "Time : " & rp(5).RoundtripTime & " ms"
Label8.Text = "Time : " & rp(5).RoundtripTime & " ms"
BackgroundWorker1.RunWorkerAsync()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
BackgroundWorker1.RunWorkerAsync()
End Sub
End Class
Zoran's Curriculum
Scan with Your android phone
Comments
Post a Comment