Pinging using ASP.Net

P

pepsi

Using ASP.Net I need to find out if a particular server is
up and running. I know the IP Address and name of the
server. Its something similar to ping command but I need
to have it at the click of a button for some reason. All I
need to know is if the server is running.

Any help is greatly appreciated.

Pepsi
 
J

John Timney \(Microsoft MVP\)

try this, shows you how to do it via sockets in a simple web service, from
there its easy to wrap an asp.net page around it

http://www.411asp.net/home/tutorial/howto/networkf/pingfunc

--
Regards

John Timney (Microsoft ASP.NET MVP)
----------------------------------------------
<shameless_author_plug>
Professional .NET for Java Developers with C#
ISBN:1-861007-91-4
Professional Windows Forms
ISBN: 1861005547
Professional JSP 2nd Edition
ISBN: 1861004958
Professional JSP
ISBN: 1861003625
Beginning JSP Web Development
ISBN: 1861002092
</shameless_author_plug>
 
S

Scott McKinney

You can import System.Net and do something like this in
the click event of your button:

Dim server As String = "207.46.134.222"

Try
Dim hostInfo As IPHostEntry = Dns.GetHostByAddress(server)
Catch ex As Exception
Response.Write("OFF, host turned off")
End Try
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,099
Messages
2,570,626
Members
47,237
Latest member
David123

Latest Threads

Top