473,662 Members | 2,375 Online
Bytes | Software Development & Data Engineering Community
+ 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.Sock ets

Public Class Form1
Inherits System.Windows. Forms.Form

#Region " Windows Form Designer generated code "

Private Sub Button1_Click(B yVal sender As System.Object, ByVal e
As System.EventArg s) 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.Conne ct(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 29986
Hello,

"gallaczmit " <ga********@yah oo.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
1435
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 won't be able to know and I try to print a document I will get an error. Is there anyway that I can check the status for the printer that the user select is ready or not?
1
2001
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 the sub form, closed or open.
4
2498
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
3675
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 should read the same XML file from a backup server. Does anyone have any idea how to achive that?? Any help is appreciated.
10
6638
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 ideas how I can check our site status with a c# application every few minutes or so to keep a log of information about the "health" of our website? Any help is appreciated. Thanks, Trint
5
1306
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): self.status = "happy" def change_status(self, new_status):
0
1312
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, status): self.status = status self.state = 'run' def start(self): self.athread = threading.Thread(target=self.print_status)
0
1625
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 ===> LOAD DATA LOG NO INDDN SYSREC REPLACE INTO TABLE creator.tablename1 NOCOPYPEND LOAD DATA LOG NO INDDN SYSREC REPLACE INTO TABLE creator.tablename2 NOCOPYPEND But after loading some of the tables are...
0
8762
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8545
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8633
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6185
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4179
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4347
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2762
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 we have to send another system
2
1992
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1747
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.