New
#1
iPing - My first Application with a GUI!
Well here we are, I present you iPing!
This program allows you to ping any host, (www.***.com or an IP) and tells you the response in "MS".
Opinions would be nice, any problems let me know.
Here is the Source code for any suspicious people:
I Have attached the Setup in a Zip file for you all.Code:Option Strict Off COPYRIGHT HARRIE PATEMAN © 2014-2016 Imports System.Net Public Class Form1 Dim IPAddress As String Public Property CheckingPing As Boolean = False #Region "Ping Function" Private Function DoPing(ByVal Address As String) As Long Dim p As New NetworkInformation.Ping Dim r As NetworkInformation.PingReply Try r = p.Send(Address) Return r.RoundtripTime Catch ex As Exception Return -1 End Try End Function #End Region Private Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click If CheckingPing = False Then If Not TextBox1.Text = String.Empty Then Timer1.Start() Timer1.Enabled = True CheckingPing = True Button1.Text = "Stop" TextBox1.Enabled = False Else MessageBox.Show("Please Enter a Host!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error) End If Else Timer1.Stop() Timer1.Enabled = False CheckingPing = False Button1.Text = "Start" TextBox1.Enabled = True End If End Sub Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As EventArgs) Handles Timer1.Tick Dim ms As Long = DoPing(TextBox1.Text) If ms >= 0 Then TextBox2.Text = "Ping: " & ms.ToString & "ms" & " - Online!" Else TextBox2.Text = "Cant connect to """ & TextBox1.Text & """" Timer1.Stop() Timer1.Enabled = False TextBox1.Enabled = True CheckingPing = False Button1.Text = "Start" End If End Sub Private Sub Form1_Shown(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Shown TextBox1.Focus() End Sub Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) End Sub Private Sub GroupBox2_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GroupBox2.Enter End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Close() End Sub Private Sub ToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) AboutBox1.ShowDialog() End Sub Private Sub HelpToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles HelpToolStripMenuItem.Click AboutBox1.ShowDialog() End Sub Private Sub AboutToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) AboutBox1.ShowDialog() End Sub End Class