For Begining....

I decided to make this blog just to in next couple years i laugh on what i did in the past...
Usually on my work i have some demands regarding job i work on, parallel with that i were experimenting and making test to some fields i used to scratch surface few years ago.
I were interested in network probing, testing, and interests as such lead me to couple applications i made
just to test network quality.
On this window I got UI which allows me to enter IP address or web host name.
After name entered, all i have to do is press PinGuj button
And it comes to this...
Simple Ping application Which allowed me to check is the some PC on the network alive, or is there Internet connection by pinging some external IP address.
Source CODE:

Public Class Form1


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim command As String
command = "ping -t " + TextBox1.Text
Shell("cmd.exe /k" & command, AppWinStyle.NormalFocus)
' komanda za pokretanje command prompt-a i egzekuciju ping komande

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Me.Close()
End Sub

Private Sub OPingericiToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OPingericiToolStripMenuItem.Click
Form2.Show()
End Sub

Private Sub ZatvoriPingericuToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ZatvoriPingericuToolStripMenuItem.Click
Me.Close()
End Sub

Private Sub TextBox1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown
If e.KeyCode = Keys.Enter Then
Dim command As String
command = "ping -t " + TextBox1.Text
Shell("cmd.exe /k" & command, AppWinStyle.NormalFocus)
'deo koji reaguje na okidanje tastera ENTER posle unesenog stringa
End If
End Sub

Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
End Sub
End Class



Next application is similar to up mentioned, difference is that here result of pinging remote machine is displayed trough label, not in the CMD window, and is limited to the result TRUE or FALSE.

Here is window for IP or domain name 
 After info in
And then it comes result, Label background color is changing depending of ping true or false
simple tool for those who wants to learn basics of network probing.
Source CODE:

Imports System.Net.NetworkInformation

Public Class Form1
Dim Ping As Ping
Dim pReply As PingReply

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Try

Ping = New Ping
pReply = Ping.Send(TextBox1.Text)
Label1.Text = pReply.Status.ToString
If pReply.Status = IPStatus.Success Then
Label1.BackColor = Color.Green
Else
Label1.BackColor = Color.Red
End If
Catch ex As Exception

MessageBox.Show(ex.InnerException.Message)

End Try
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Me.Close()
End Sub

Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click

End Sub
End Class 




Zoran's Curriculum
Scan with Your android phone

Comments