473,467 Members | 1,590 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Ping IP - Check host status

Will this code give me a true view of a computer's status? All I am
looking for is to see if the computer is reachable or not.

My end goal is to get a list of IP addresses from a MS SQL Server, see
if the IP is reachable(if yes I will assume the pc is operational),
update the database with the result and generate a web page displaying
the results.

I am using port 135 because I have an all windows network and this
port should be open on all pcs (I think). I think I can also use this
to check the status of server services? - check 80 for IIS, 53 for
DNS........

Any suggestions/comments would be appreciated for this .net hack.
Imports System.Net
Imports System.Net.Sockets

Public Class Form1
Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

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

Dim tcpClient As New TcpClient
Dim IP As String = "192.168.0.1"
Dim Port As Int32 = "135"
Dim IPAddress As IPAddress = IPAddress.Parse(IP)

Try
tcpClient.Connect(IP, Port)
Label3.Text = "Ping is OK"
Catch err As Exception
Label3.Text = "Ping not OK"
End Try

End Sub

End Class
Nov 20 '05 #1
1 29946
Hello,

"gallaczmit" <ga********@yahoo.com> schrieb:
Will this code give me a true view of a computer's status? All I am
looking for is to see if the computer is reachable or not.


If you want to perform a real ping, have a look at these sources (C#):

http://www.csharphelp.com/archives2/archive296.html
http://www.c-sharpcorner.com/network/ping.asp

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Vanessa | last post by:
Hi, I'm trying to select a printer in the system printers collection. I'm able to do this. However, if the printer is a network printer and happens that this printer is not on or not ready, I...
1
by: S. van Beek | last post by:
Dear reader, If there are no records available for a sub form the sub form will not show any thing in the form, the sub form is closed. Is there a code in VBA to check the status of...
4
by: ramapv | last post by:
I need to check the status of the checkboxes in one form and display the checked values in another form. How can i?
6
by: test2000 | last post by:
Hello I'm trying to write a javascript that checks if a server/host is available. To be more precice. I would like to check if the browser can read an XML file from a server. If not the script...
10
by: trint | last post by:
Recently the host for our website has been going down for unknown reasons like three or four times a week, which obviously means that we are loosing business during the down time. Any one know...
5
by: futileissue | last post by:
Beginner, so please bare with me. I'm not sure what to call what it is I'm looking for. If I have an object class, let's call it "Creature": class Creature: def __init__(self, status):...
0
by: Edwin.Madari | last post by:
updated creature running in its own thread will get you started. try it foryourself, change sleep times per your need. import os, sys, threading, time class Creature: def __init__(self,...
0
by: srilata83 | last post by:
Hi, we are running some DB2 load utilty job to empty the DB2 (multiple) tables by loading with a dummy file.we are giving in the control card as follows ===> ...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.