iPing - My first Application with a GUI!

HarriePateman

BSOD Analyst
Guru
Gold Member
VIP
Local time
4:35 PM
Messages
3,302
Location
South UK, Bournemouth
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:

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
I Have attached the Setup in a Zip file for you all.
 

Attachments

  • iPing.rar
    iPing.rar
    718.9 KB · Views: 16
  • 1.png
    1.png
    17.5 KB · Views: 83
  • 2.png
    2.png
    10 KB · Views: 83

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Custom Build
OS
Windows 7 Ultimate 64-bit
CPU
Intel G3420 3.2GHZ Dual Core
Motherboard
Gigabyte H87-HD3
Memory
Kingson 8GB 1600mhz
Graphics Card(s)
MSI R7970 TF 3GD5/OC BE
Monitor(s) Displays
21" LG & "19 Vertical Samsung
Hard Drives
120GB SSD - Boot
1TB WD
350GB External
2TB External (Wireless)
PSU
Corsair CX 500 modular
Case
Zalman Z11 Plus (modified)
Cooling
Corsair H55, 2x 120mm SP Corsair, 1x 140 Coolermaster
Keyboard
Corsair K50
Mouse
CSL Gaming
Internet Speed
164Mbps
Antivirus
Avast, Malwarebytes
Browser
Google Chrome, IE, Firefox
Can Someone let me know if it download okay? and the setup went smooth?
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Custom Build
OS
Windows 7 Ultimate 64-bit
CPU
Intel G3420 3.2GHZ Dual Core
Motherboard
Gigabyte H87-HD3
Memory
Kingson 8GB 1600mhz
Graphics Card(s)
MSI R7970 TF 3GD5/OC BE
Monitor(s) Displays
21" LG & "19 Vertical Samsung
Hard Drives
120GB SSD - Boot
1TB WD
350GB External
2TB External (Wireless)
PSU
Corsair CX 500 modular
Case
Zalman Z11 Plus (modified)
Cooling
Corsair H55, 2x 120mm SP Corsair, 1x 140 Coolermaster
Keyboard
Corsair K50
Mouse
CSL Gaming
Internet Speed
164Mbps
Antivirus
Avast, Malwarebytes
Browser
Google Chrome, IE, Firefox
Seems like a nice and useful one. Let me give my opinion:

First the "setup". It works as expected, and but just places a shortcut on the start menu. Really, ClickOnce is amont the most unprofessional ways of installing things, it has serious drawbacks and is so coupled with .NET to make it hard to use anywhere else. Just use a serious install system, there are many ones out there, the built-in things in Visual Studio are crap on this. Or even better, just distribute the exe file alone, as it's all you need to run, and you've got a "portable" one.

Then about the program. It works well, more or less, but with a few things. Under the hood, it keeps pinging until you stop, this is not so evident, the single textbox for the result makes the impression that a single packet it sent while it really keeps bombarding until you stop or exit. The ideal for me would be a grid (the built-in listview in detail mode is great) with a row for each packet, much like the real console-based ping. And if I were to request even more stuff, the option to customize the number of packets and packet size would be great :p. Just like in the original ping.

A few bugs: The result textbox must be read-only (not so nice to be able to tamper the results).
When pinging a non-existent name (a host that the DNS server cannot resolve), the result is "Cant connect to", and the hostname is truncated if it's too long.
When pinging a non-existent IP (or a name resolved to a non-existeng IP), it reports a 0ms, successful ping, it should return an error instead.
The window can be maximized. This just fills the whole screen with a blank window with the controls in a corner. Disabling the maximize button will solve this.
Not really a bug, but pressing enter in the host textbox should initiate ping, and pressing esc could exit immediately. Just eye candy :)

All in all, nice program.
 

My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
Toshiba Sattelite A665-S6092
OS
Windows 7 Ultimate x64
CPU
Intel Core i7-740QM
Memory
8 GB DDR3
Graphics Card(s)
NVIDIA GeForce 330GT
Screen Resolution
1366x768
Hard Drives
Samsung 840 SSD 500GB
1TB USB3 external HD
Cooling
Coolermaster Notepal U3 notebook cooling pad
Internet Speed
3mbps ASDL
Antivirus
ClamWin 0.98.7
Browser
Opera 12.17 x86 (main), Firefox 38 (sec), IE11 (last resort)
Out of my league Harry and mate that is a nom de plume email address? else you will get a bit of spam eh?
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Own build (new) Desk1 / Asus ROG Win 7 / Desk2 1st build
OS
Desk1 7 Home Prem / Desk2 10 Pro / Main lap Asus ROG 10 Pro 2 laptop Toshiba 7 Pro Asus P2520 7 & 10
CPU
Desk1 i5 3750K / Laptop i7 GTX 860M / Desk2 i5 2500
Motherboard
Desk1 Asus P877-V / Desk2 Gigabyte H67 UD3H / Laptop ?
Memory
Desk1 8GB (1866) / Desk2 16GB (1333) / Laptop 8Gb DDR3
Graphics Card(s)
Desk 1& 2NVidia GTX 650 & Laptops on board Intel
Sound Card
Desk 1 & 2 -XONAR DG Realtek High Def audio Laptop
Monitor(s) Displays
Desk 1 Benq HD 2450 / Desk2 Philips 24" / Laptop 17.5"
Screen Resolution
1920x1080 D1 & D2 & Laptop 1
Hard Drives
Desk1 Samsung 120GB 830 SSD
Asus ROG 256GB 850 Pro SSD
Desk2 Samsung 840 256 SSD
Toshiba 120GB EVO
PSU
Desk 1 Corsair HX 1050/ Laptop ? / Desk 2 Corsair HX 650
Case
Desk 1 Cooler HAF XM ? Toshiba laptop / Desk2 Coolermaster
Cooling
Fans on all Desk1 -2 Desk2 - all Coolermasters 5 Laptop ?
Keyboard
Desk 1 MS Sidewinder X6 Desk 2 MS Sidewinder X 4
Mouse
Desk 1&2 - Gigabyte MS 900 gamer - laptop - Logitec wireless
Internet Speed
ADSL2+
Other Info
One other Desktop (tester) and spare Toshba laptop both with SSD's
Running Kaspersky 2016 ISS on all machines config'd identically
Logitec audio stereo systems on each machine (x3)
Canon MG5250MFC
Router/modem TP-Link running WPA2SK
Alejandro85, thank you for the advice. You really seem like you know yours stuff i would like to see some of your work? I understand what you mean about the .exe's my other developments i have just posted the .exe's.

ICit2lol - spam away ;)
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Custom Build
OS
Windows 7 Ultimate 64-bit
CPU
Intel G3420 3.2GHZ Dual Core
Motherboard
Gigabyte H87-HD3
Memory
Kingson 8GB 1600mhz
Graphics Card(s)
MSI R7970 TF 3GD5/OC BE
Monitor(s) Displays
21" LG & "19 Vertical Samsung
Hard Drives
120GB SSD - Boot
1TB WD
350GB External
2TB External (Wireless)
PSU
Corsair CX 500 modular
Case
Zalman Z11 Plus (modified)
Cooling
Corsair H55, 2x 120mm SP Corsair, 1x 140 Coolermaster
Keyboard
Corsair K50
Mouse
CSL Gaming
Internet Speed
164Mbps
Antivirus
Avast, Malwarebytes
Browser
Google Chrome, IE, Firefox
Alejandro85, thank you for the advice. You really seem like you know yours stuff i would like to see some of your work? I understand what you mean about the .exe's my other developments i have just posted the .exe's.

ICit2lol - spam away ;)
Only the spam you eat in that sandwich you have mate:roflmao:
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Own build (new) Desk1 / Asus ROG Win 7 / Desk2 1st build
OS
Desk1 7 Home Prem / Desk2 10 Pro / Main lap Asus ROG 10 Pro 2 laptop Toshiba 7 Pro Asus P2520 7 & 10
CPU
Desk1 i5 3750K / Laptop i7 GTX 860M / Desk2 i5 2500
Motherboard
Desk1 Asus P877-V / Desk2 Gigabyte H67 UD3H / Laptop ?
Memory
Desk1 8GB (1866) / Desk2 16GB (1333) / Laptop 8Gb DDR3
Graphics Card(s)
Desk 1& 2NVidia GTX 650 & Laptops on board Intel
Sound Card
Desk 1 & 2 -XONAR DG Realtek High Def audio Laptop
Monitor(s) Displays
Desk 1 Benq HD 2450 / Desk2 Philips 24" / Laptop 17.5"
Screen Resolution
1920x1080 D1 & D2 & Laptop 1
Hard Drives
Desk1 Samsung 120GB 830 SSD
Asus ROG 256GB 850 Pro SSD
Desk2 Samsung 840 256 SSD
Toshiba 120GB EVO
PSU
Desk 1 Corsair HX 1050/ Laptop ? / Desk 2 Corsair HX 650
Case
Desk 1 Cooler HAF XM ? Toshiba laptop / Desk2 Coolermaster
Cooling
Fans on all Desk1 -2 Desk2 - all Coolermasters 5 Laptop ?
Keyboard
Desk 1 MS Sidewinder X6 Desk 2 MS Sidewinder X 4
Mouse
Desk 1&2 - Gigabyte MS 900 gamer - laptop - Logitec wireless
Internet Speed
ADSL2+
Other Info
One other Desktop (tester) and spare Toshba laptop both with SSD's
Running Kaspersky 2016 ISS on all machines config'd identically
Logitec audio stereo systems on each machine (x3)
Canon MG5250MFC
Router/modem TP-Link running WPA2SK
yummy ;)
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Custom Build
OS
Windows 7 Ultimate 64-bit
CPU
Intel G3420 3.2GHZ Dual Core
Motherboard
Gigabyte H87-HD3
Memory
Kingson 8GB 1600mhz
Graphics Card(s)
MSI R7970 TF 3GD5/OC BE
Monitor(s) Displays
21" LG & "19 Vertical Samsung
Hard Drives
120GB SSD - Boot
1TB WD
350GB External
2TB External (Wireless)
PSU
Corsair CX 500 modular
Case
Zalman Z11 Plus (modified)
Cooling
Corsair H55, 2x 120mm SP Corsair, 1x 140 Coolermaster
Keyboard
Corsair K50
Mouse
CSL Gaming
Internet Speed
164Mbps
Antivirus
Avast, Malwarebytes
Browser
Google Chrome, IE, Firefox

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Own build (new) Desk1 / Asus ROG Win 7 / Desk2 1st build
OS
Desk1 7 Home Prem / Desk2 10 Pro / Main lap Asus ROG 10 Pro 2 laptop Toshiba 7 Pro Asus P2520 7 & 10
CPU
Desk1 i5 3750K / Laptop i7 GTX 860M / Desk2 i5 2500
Motherboard
Desk1 Asus P877-V / Desk2 Gigabyte H67 UD3H / Laptop ?
Memory
Desk1 8GB (1866) / Desk2 16GB (1333) / Laptop 8Gb DDR3
Graphics Card(s)
Desk 1& 2NVidia GTX 650 & Laptops on board Intel
Sound Card
Desk 1 & 2 -XONAR DG Realtek High Def audio Laptop
Monitor(s) Displays
Desk 1 Benq HD 2450 / Desk2 Philips 24" / Laptop 17.5"
Screen Resolution
1920x1080 D1 & D2 & Laptop 1
Hard Drives
Desk1 Samsung 120GB 830 SSD
Asus ROG 256GB 850 Pro SSD
Desk2 Samsung 840 256 SSD
Toshiba 120GB EVO
PSU
Desk 1 Corsair HX 1050/ Laptop ? / Desk 2 Corsair HX 650
Case
Desk 1 Cooler HAF XM ? Toshiba laptop / Desk2 Coolermaster
Cooling
Fans on all Desk1 -2 Desk2 - all Coolermasters 5 Laptop ?
Keyboard
Desk 1 MS Sidewinder X6 Desk 2 MS Sidewinder X 4
Mouse
Desk 1&2 - Gigabyte MS 900 gamer - laptop - Logitec wireless
Internet Speed
ADSL2+
Other Info
One other Desktop (tester) and spare Toshba laptop both with SSD's
Running Kaspersky 2016 ISS on all machines config'd identically
Logitec audio stereo systems on each machine (x3)
Canon MG5250MFC
Router/modem TP-Link running WPA2SK
Alejandro85, thank you for the advice. You really seem like you know yours stuff i would like to see some of your work? I understand what you mean about the .exe's my other developments i have just posted the .exe's.

No problem, nice work, not bad for a first try. Yeah, I know this stuff, I make my living programming :p I must know it. Never published anything myself, the few things I've done on my own remain in my disk, mostly unused, never think of anyone being interested anyway.

I still have to try the second version of this one!
 

My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
Toshiba Sattelite A665-S6092
OS
Windows 7 Ultimate x64
CPU
Intel Core i7-740QM
Memory
8 GB DDR3
Graphics Card(s)
NVIDIA GeForce 330GT
Screen Resolution
1366x768
Hard Drives
Samsung 840 SSD 500GB
1TB USB3 external HD
Cooling
Coolermaster Notepal U3 notebook cooling pad
Internet Speed
3mbps ASDL
Antivirus
ClamWin 0.98.7
Browser
Opera 12.17 x86 (main), Firefox 38 (sec), IE11 (last resort)
Alejandro85, thank you for the advice. You really seem like you know yours stuff i would like to see some of your work? I understand what you mean about the .exe's my other developments i have just posted the .exe's.

No problem, nice work, not bad for a first try. Yeah, I know this stuff, I make my living programming :p I must know it. Never published anything myself, the few things I've done on my own remain in my disk, mostly unused, never think of anyone being interested anyway.

I still have to try the second version of this one!

The second one is much better!
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Custom Build
OS
Windows 7 Ultimate 64-bit
CPU
Intel G3420 3.2GHZ Dual Core
Motherboard
Gigabyte H87-HD3
Memory
Kingson 8GB 1600mhz
Graphics Card(s)
MSI R7970 TF 3GD5/OC BE
Monitor(s) Displays
21" LG & "19 Vertical Samsung
Hard Drives
120GB SSD - Boot
1TB WD
350GB External
2TB External (Wireless)
PSU
Corsair CX 500 modular
Case
Zalman Z11 Plus (modified)
Cooling
Corsair H55, 2x 120mm SP Corsair, 1x 140 Coolermaster
Keyboard
Corsair K50
Mouse
CSL Gaming
Internet Speed
164Mbps
Antivirus
Avast, Malwarebytes
Browser
Google Chrome, IE, Firefox
Back
Top