Smart-DoS Tracing the route and getting ping responses 01-20-2013, 07:04 AM
#1
Using this you should easily be able to implement it into your program. This can also be used to test ping speeds and look at the amount of stress on all of the routing your server is taking.
So basically there is no built in method for Tracert in VB.Net sooo I did it the "cheap" way with finding an online one and using a HTTPWebRequest and splitting the source code if had as a result for the host.
Components:
1 Multilined Textbox : SourceBox (used to easily transfer to the listbox)
1 Normal Textbox : IP_Input
3 listboxes : TracertIPLstBox, PingTimeLstBox, TracertLstBox
I hope this helps someone. Probably the easiest way to do this but I just made it for an example of what you are essentially going for.
SOURCE: Download
If you like this or are going to use. Please drop me a thanks to show your appreciation.
-- RA1N
So basically there is no built in method for Tracert in VB.Net sooo I did it the "cheap" way with finding an online one and using a HTTPWebRequest and splitting the source code if had as a result for the host.
Components:
1 Multilined Textbox : SourceBox (used to easily transfer to the listbox)
1 Normal Textbox : IP_Input
3 listboxes : TracertIPLstBox, PingTimeLstBox, TracertLstBox
Code:
Imports System.Net
Imports System.IO
Public Class Form1
Dim s As String
Dim h As String
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
If IP_Input.Text = Nothing Then
MsgBox("Please inset the Host IP or URL in the textbox.")
Return
End If
If IP_Input.Text.Contains("www") Or IP_Input.Text.Contains("net") Or IP_Input.Text.Contains("org") Or IP_Input.Text.Contains("gov") Then
Dim Hostname = Dns.GetHostEntry(IP_Input.Text)
Dim ip As IPAddress() = Hostname.AddressList
If ip(0).ToString.Contains(":") Then
MsgBox("Invalid URL!")
Return
Else
h = ip(0).ToString
End If
Else
h = IP_Input.Text
End If
MsgBox("Getting Route for: " & h)
MsgBox("This may take a bit based on your internet speed!, This is due to the HTTPWebRequest Used for routing!")
TracertIPLstBox.Items.Clear()
TracertLstBox.Items.Clear()
PingTimeLstBox.Items.Clear()
s = getSource("http://www.tracert.org/cgi-bin/traceroute/tracert.pl?t=" & h)
Dim ss() = Split(s, "<PRE>")
Dim sss() = Split(ss(1), "</PRE>")
SourceBox.Text = sss(0)
TracertLstBox.DataSource = SourceBox.Lines
For i = 0 To TracertLstBox.Items.Count - 2
Dim a() = Split(TracertLstBox.Items.Item(i), " ")
Dim aa() = Split(a(1), " (")
Dim aaa() = Split(aa(1), ")")
TracertIPLstBox.Items.Add(aaa(0))
Dim b() = Split(a(2), " ")
PingTimeLstBox.Items.Add(b(0))
Next
Catch ex As Exception
MsgBox("Error: " & ex.Message)
MsgBox("If you get an error it may have no connected to the website for routing")
End Try
End Sub
Public Function getSource(ByVal url As String) As String
Dim HTMLSource As String = ""
Dim Request As HttpWebRequest = WebRequest.Create(url)
Dim Response As HttpWebResponse = Request.GetResponse
Dim SR As StreamReader
SR = New StreamReader(Response.GetResponseStream)
HTMLSource = SR.ReadToEnd
SR.Close()
Return HTMLSource
End Function
End ClassI hope this helps someone. Probably the easiest way to do this but I just made it for an example of what you are essentially going for.
SOURCE: Download
If you like this or are going to use. Please drop me a thanks to show your appreciation.

-- RA1N
[username], need some help?, PM me.
![[Image: kjKks6Y.png]](http://i.imgur.com/kjKks6Y.png)
![[Image: kjKks6Y.png]](http://i.imgur.com/kjKks6Y.png)




![[+]](https://sinister.li/images/modern/collapse_collapsed.png)


![[Image: 2YpkRjy.png]](http://i.imgur.com/2YpkRjy.png)