Hack Forums
[.NET] [SourceCode] ConsoleApp Pinger - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [.NET] [SourceCode] ConsoleApp Pinger (/showthread.php?tid=151554)



[SourceCode] ConsoleApp Pinger - The-One - Sep 21, 2009

Hello HF!

Version Used : Visual Basic 2008

My i whas doing some things with some codes and this is what came out ;P
Code
Imports System.Console
Imports System.Net

Module Module1

    Sub Main()

Start:
        Dim h As System.Net.IPHostEntry = System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName)
        WriteLine(" ")
        Console.Title = " The-One's Host Pinger"
        Console.ForegroundColor = ConsoleColor.Green
        WriteLine("[" & TimeOfDay & "]" & " Created by The-One, For the better host pinging")
        WriteLine(" ")

        Console.ForegroundColor = ConsoleColor.White
        Write("[" & TimeOfDay & "]" & " " & h.AddressList.GetValue(0).ToString & " [This is YOUR Host]")
        Console.ForegroundColor = ConsoleColor.Green
        WriteLine(" ")

        Write("[" & TimeOfDay & "]" & " Write the website name : " & vbCrLf & "[" & TimeOfDay & "]" & " Example: www.website.com" & vbCrLf)
        Console.ForegroundColor = ConsoleColor.Cyan

        Dim Host As String
        Host = ReadLine()
        Dim hostname As IPHostEntry = Dns.GetHostEntry(Host)
        Dim ip As IPAddress() = hostname.AddressList

        Console.ForegroundColor = ConsoleColor.White
        Write("[" & TimeOfDay & "]" & " The ip of " & Host & " = " & ip(0).ToString() & vbCrLf)
        Console.ForegroundColor = ConsoleColor.Green
        Write("[" & TimeOfDay & "]" & " Thank You For Using My Application." & vbCrLf)

        Console.ForegroundColor = ConsoleColor.Green
        Write("[" & TimeOfDay & "]" & " Want to move on? 'yes' (Else hit a random key to close!)" & vbCrLf)
        Console.ForegroundColor = ConsoleColor.Cyan
        Dim MoveOn As String
        MoveOn = ReadLine()
        If MoveOn = "yes" Then
            GoTo Start
        Else : GoTo Quit
        End If
Quit:
    End Sub

End Module

Download Source :
http://ul.to/n9d1ia


* - TheBlackMarket - Sep 21, 2009

Nice code bro, thanks for share it!


* - codepoet - Apr 30, 2010

good sources....thanks