473,765 Members | 1,979 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to ping another computer in Vb 2005

Hi, All,

I try to ping another PC using ping in vb 2005, can anyone provide a snippet
of code?

Thanks in advance,
Martin
Mar 7 '07 #1
5 6587
well you can do it via the command line and the SHELL command...
right?

you could pipe this into a text file; and then you wouldn't have any
external dependencies

this way you can also get multiple ping values; that's more important
than a single value

if that doesn't work i'd check out www.freevbcode.com


On Mar 7, 11:56 am, martin1 <mart...@discus sions.microsoft .comwrote:
Hi, All,

I try to ping another PC using ping in vb 2005, can anyone provide a snippet
of code?

Thanks in advance,
Martin

Mar 7 '07 #2
On Mar 7, 2:56 pm, martin1 <mart...@discus sions.microsoft .comwrote:
Hi, All,

I try to ping another PC using ping in vb 2005, can anyone provide a snippet
of code?

Thanks in advance,
Martin
Search for "ping" in the object browser - there are several methods to
do this.

Thanks,

Seth Rowe

Mar 7 '07 #3
martin1 wrote:
Hi, All,

I try to ping another PC using ping in vb 2005, can anyone provide a snippet
of code?

Thanks in advance,
Martin
OK, some very rough code (that works) -

Imports System.Net.Netw orkInformation

Dim Ping As New Ping
Dim PingOptions As New PingOptions
PingOptions.Ttl = 64
Dim PingReply As PingReply = Ping.Send("192. 168.1.1", 500)
If PingReply.Statu s = IPStatus.Succes s Then
'Do Something...
End If

Hope this is enough to get you started.

Also, look up PING in the on-line help.

ShaneO

There are 10 kinds of people - Those who understand Binary and those who
don't.
Mar 7 '07 #4
Martin,

In addition to the other responses, VB 2005 offers My.Computer.Net work.Ping.

Kerry Moorman
"martin1" wrote:
Hi, All,

I try to ping another PC using ping in vb 2005, can anyone provide a snippet
of code?

Thanks in advance,
Martin
Mar 7 '07 #5
You know how I can make a Ipconfig for get my own IP, and the data of my
NetCard.

Thanks in advance.

Freddy Coal

"ShaneO" <sp****@optusne t.com.auwrote in message
news:45******** **************@ news.optusnet.c om.au...
martin1 wrote:
>Hi, All,

I try to ping another PC using ping in vb 2005, can anyone provide a
snippet of code?

Thanks in advance,
Martin

OK, some very rough code (that works) -

Imports System.Net.Netw orkInformation

Dim Ping As New Ping
Dim PingOptions As New PingOptions
PingOptions.Ttl = 64
Dim PingReply As PingReply = Ping.Send("192. 168.1.1", 500)
If PingReply.Statu s = IPStatus.Succes s Then
'Do Something...
End If

Hope this is enough to get you started.

Also, look up PING in the on-line help.

ShaneO

There are 10 kinds of people - Those who understand Binary and those who
don't.

Mar 8 '07 #6

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

Similar topics

14
4971
by: Mickel Grönroos | last post by:
Hi all, I have a silly question. Is there are simple way to check if the computer is connected to the Internet? It seems this should be a pretty straight-forward thing to do, but as I am totally unfamiliar with sockets and such, I ask for your help before getting my hands dirty. Cheers, Mickel G.
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
2688
by: MattPKaiser | last post by:
I am trying to find a way to check if a computer on a network is "online" so that I can access a file on a share. In short I maintain a list of computers that have my service running (in the client application) and in my client program I allow the user to change the computer that they are accessing. If a computer that is on the list becomes unplugged and I try to access a file with a FileStream the filestream creation takes 8-10...
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
3
11874
by: SyGC | last post by:
Hi People, Im trying to do a simple Loop where by an IP address is pinged (Using My.computer.network.ping) and the results, true or false, are used to invoke another line of code. Basically if the IP is pingable (true) image A is displayed if it is not (false) then image B is. The code i am using is as follows Dim IPAddress As String = "192.168.1.122"
0
1486
by: SyGC | last post by:
Hi Guys, I have used Threading for Network.Ping to continuously ping an IP address if ping is successful Image A is displayed if not Image B. The code is as follows: Imports System Imports System.Diagnostics Imports System.Threading Public Class Form1
4
2243
by: Newbie | last post by:
Is it possible, without any 3rd party tools to simply ping an ip address, and get back if the ping was sucessfull. Thanks
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...
6
8191
by: munkee | last post by:
I am sending semi automated emails within my access database using our companies internal smtp server. One of the issues I had was capturing whether people were connected to the lan to be able to send these emails. I decided to use a ping to test whether the server was giving a response, if it was then they must be connected and if not then they arent. The ping code is as follows: Option Explicit 'Ping function. Original Source code...
0
9568
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
9398
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,...
1
9951
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
8831
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
7378
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
6649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5275
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...
1
3924
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
3
2805
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.