Hack Forums
[.NET] How to Create a Ping - 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] How to Create a Ping (/showthread.php?tid=4552874)



How to Create a Ping - xXGelonpetronXx - Nov 24, 2014

OK! First we open the Visual Basic 2010.
We put Windows Forms Application and as the name Ping IP.
Now follow the steps!
Take 1 Button 2 TextBox.
Click on Forms and Let's put this code just above Pubblic Class:

PHP Code

<?php 
Imports System
.Net 

Now click on the button and in the Click event we put this code:

PHP Code

<?php 
Dim hostname 
As IPHostEntry = Dns.GetHostByName(TextBox3.Text)
      
Dim indirizzo As IPAddress() = hostname.AddressList
      TextBox4
.Text = indirizzo(0).ToString 

Now We initiate the Debug and you're done!


* - SIM-2137258 - Nov 24, 2014

More Simple :
Code
Imports System.Net

Public Class Form1

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
      If My.Computer.Network.Ping(TextBox1.Text) Then
      MsgBox("Server pinged successfully.")
      Else
      MsgBox("Ping request timed out.")
      End If

    End Sub
End Class



* - zeroexp - Nov 24, 2014

OP doesn't even know what his code does. That's not "pinging an IP".


* - AimBRoT - Nov 24, 2014

Every1 on HF should know how to Ping ... but okay thanks ^^


* - Huntsman Knife - Nov 24, 2014

(Nov 24, 2014 09:21 AM)AimBRoT Wrote:  Every1 on HF should know how to Ping ... but okay thanks ^^

So I assume you know how to ping in every single programming language in the history.


* - aeiro - Nov 24, 2014

(Nov 24, 2014 02:44 PM)Huntsman Knife Wrote:  So I assume you know how to ping in every single programming language in the history.

well considering source is for windows. i think your assumption is irrelevant.