Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: iPing - My first Application with a GUI!

4 Weeks Ago   #1

Windows 7 Ultimate 64-bit
 
 
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:

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.



Attached Images
  
Attached Files
File Type: rar iPing.rar (718.9 KB, 7 views)
My System SpecsSystem Spec
.

4 Weeks Ago   #2

Windows 7 Ultimate 64-bit
 
 

Can Someone let me know if it download okay? and the setup went smooth?
My System SpecsSystem Spec
4 Weeks Ago   #3

Windows 7 Ultimate x64
 
 

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 . 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 System SpecsSystem Spec
.


4 Weeks Ago   #4

Desk1 8 Pro / Desk2 7 Home Prem / Laptop 8.1 Pro all 64bit
 
 

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 System SpecsSystem Spec
4 Weeks Ago   #5

Windows 7 Ultimate 64-bit
 
 

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 System SpecsSystem Spec
4 Weeks Ago   #6

Desk1 8 Pro / Desk2 7 Home Prem / Laptop 8.1 Pro all 64bit
 
 

Quote   Quote: Originally Posted by HarriePateman View Post
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
My System SpecsSystem Spec
4 Weeks Ago   #7

Windows 7 Ultimate 64-bit
 
 

yummy
My System SpecsSystem Spec
4 Weeks Ago   #8

Desk1 8 Pro / Desk2 7 Home Prem / Laptop 8.1 Pro all 64bit
 
 

Quote   Quote: Originally Posted by HarriePateman View Post
yummy
Frittered I hope
My System SpecsSystem Spec
3 Weeks Ago   #9

Windows 7 Ultimate x64
 
 

Quote   Quote: Originally Posted by HarriePateman View Post
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 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 System SpecsSystem Spec
3 Weeks Ago   #10

Windows 7 Ultimate 64-bit
 
 

Quote   Quote: Originally Posted by Alejandro85 View Post
Quote   Quote: Originally Posted by HarriePateman View Post
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 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 System SpecsSystem Spec
Reply

 iPing - My first Application with a GUI!




Thread Tools



Similar help and support threads for2: iPing - My first Application with a GUI!
Thread Forum
Solved Avoiding '<application name> is not a valid Win32 application' error. General Discussion
I disabled application info and application update in services.msc BSOD Help and Support
Win XP Mode - Cannot start virtual application. The application is blo Virtualization

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 07:10 AM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33