473,756 Members | 1,842 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ping an ip Address

Is it possible, without any 3rd party tools to simply ping an ip address,
and get back if the ping was sucessfull.
Thanks

Sep 19 '08 #1
4 2242

"Newbie" <ne****@nospam. comschrieb im Newsbeitrag
news:ej******** ******@TK2MSFTN GP04.phx.gbl...
Is it possible, without any 3rd party tools to simply ping an ip address,
and get back if the ping was sucessfull.
Thanks

Dim oPing As New Net.NetworkInfo rmation.Ping
Dim myResponse As Net.NetworkInfo rmation.PingRep ly
Dim myStatus As New clsStatus()

Try

myResponse = oPing.Send(txtC omputername.Tex t, 8)
If myResponse.Stat us = NetworkInformat ion.IPStatus.Su ccess
Then

Catch exPing As Net.NetworkInfo rmation.PingExc eption
'here the computer doesn't have a DHCP Lease anymore
MessageBox.Show ("PC not online", "Ping", MessageBoxButto ns.OK,
MessageBoxIcon. Information)

Catch ex As Sockets.SocketE xception
'here the computer is offline but still has a DHCP Lease
MessageBox.Show ("PC not online", "Socket", MessageBoxButto ns.OK,
MessageBoxIcon. Information)

End Try

Sep 19 '08 #2
On Sep 19, 3:27*am, "Newbie" <new...@nospam. comwrote:
Is it possible, without any 3rd party tools to simply ping an ip address,
and get back if the ping was sucessfull.

Thanks
Please open the object browser and search for "ping".

Alternate:

Please open google and search for "ping Visual Basic .NET"

Thanks,

Seth Rowe [MVP]
http://sethrowe.blogspot.com/
Sep 19 '08 #3
Newbie,

You can use Visual Basic's My.Computer.Net work.Ping method.

Kerry Moorman
"Newbie" wrote:
Is it possible, without any 3rd party tools to simply ping an ip address,
and get back if the ping was sucessfull.
Thanks

Sep 19 '08 #4
On Sep 19, 10:27*am, "Newbie" <new...@nospam. comwrote:
Is it possible, without any 3rd party tools to simply ping an ip address,
and get back if the ping was sucessfull.

Thanks
As Kerry pointed out, you can use My.Computer.Net work.Ping method
which returns a Boolean as True if pinging was successful.

See more for usage:
http://msdn.microsoft.com/en-us/libr...5t(VS.80).aspx

HTH,

Onur Güzel
Sep 22 '08 #5

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

Similar topics

1
1989
by: techprot-google04 | last post by:
I've found tons of sample code on pinging - but all start with the host name, resolve the ip address and do the ping. Does anyone have any sample code that does a ping from an ip address alone? OR Does anyone know how to add an ip address to the the address list of an IPHostEntry object? I've tried ihe.AddressList =... but I can't
2
2121
by: Devin | last post by:
I am trying to figure out a way to ping IP address. This is because we assign all of our IP address in house, and when we are assigning a new one, we wish to verify that it is not already in use. THis functionality needs to be webpage based though. Basically all I need is a way to tell a computer to ping a certian IP, and tell me if it is in use or not. Any ideas? If someone could provide some code that would do that it would be greatly...
0
7782
by: Ed | last post by:
I've attached some VB.NET code I've hacked together (some taken from MS examples & newsgroup postings) that will perform a ping or IcmpSendEcho using the icmp.dll (see this for more info: http://support.microsoft.com/default.aspx?scid=kb;en-us;170591 ). The problem I have is in order to perform a discovery/ping of an entire subnet (192.168.1.* for instance) I have to do a FOR loop to itterate through all of the addresses. That it seems...
2
3239
by: Ryan | last post by:
I want to ping every IP on a subnet (255 IP's) and display in a table what IP's are active. I'm currently using a For loop but this takes forever because it pauses to test each Ping. So my guess is that I need to run 255 functions each in their own thread. Would there be an easy way to do this, maybe create the functions dynamically within a loop? Any help with the syntax would be great. I haven't done much threaded programming.
5
5587
by: Deepak | last post by:
I am programing a ping application which pings various centers . I used timer loop and it pings one by one. Now when i finish pinging one center it should wait for the ping_completed function to be executed and then continue pinging another certer. The ping_completed function is called on completion of ping by the os and i have no control on it .
1
18508
by: Krish | last post by:
All, I have an offline application that works online for some data syncronization. For data syncronization I access a webservice. I want to show whether my application is online or not by checking whether the application is able to access the webservice. If the webservice is accessible, the application is online. otherwise it is offline What is the best way to ping a url in C# ?
5
5557
by: Michael M. | last post by:
I have the following code (listed at bottom of post) that pings a small range of IP address to see which ones are alive. To speed things up a little I am trying to use more than one thread, problem is instead of returning: 192.168.0.1 online
4
13201
by: =?Utf-8?B?QWxleCBLLg==?= | last post by:
Hi all I need a simple program that allows me to check if an IP address is pingable. I am not going to send/receive anything to the remote host, just check if it is visible. Something like this: private bool CheckIPAddress(string address) { if (Ping(address))
6
3459
by: Dave Marden | last post by:
I currently use this routine in vbscript to ping computers and get the status of ping to determine whether to try to backup a machine, I am trying to change it to work with vb2003.net I am wondering if anyone has a ping function they could share with me. I have done some searching on this but cannot find anything specifically for vb2003. Sub PingComputer If PingStatus(PCName) = "Success" Then
6
4209
by: belias | last post by:
So...here we go. I'm having an issue with one computer on a network not being able to ping other computers by name. I've spent the last day searching similar issues and I've tried all the steps recommended. If anyone has some suggestions, I'd love to give them a try - this is driving me nuts!! I am connected via wired-LAN to a Linksys WRT-600N router; there are 4 other computers on the network. The other 3 computers are working perfectly...
0
9456
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9275
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10034
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9843
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
9713
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...
0
8713
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7248
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...
1
3805
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
3358
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.