473,499 Members | 1,681 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Ping and Tracert

Hi
I need a VB dotnet ping and tracert GUI utility written in VB.net 2003
(not 2005).

I was sure there would have been many working examples for ping but I cannot
find any :(
I was hoping to find one I could just add to my app as there is no point in
reinventing the wheel! I could live without the tracert, but I do need it to
run from a windows form.

any links

thanks
Nov 21 '05 #1
2 4035
Adrian,

Almost all my samples are in VBNet code, this one I have only in C#, can you
use this.
(at least 80% is almost exactly the same in VBNet)
Process p = new Process();
ProcessStartInfo pi = new ProcessStartInfo();
pi.UseShellExecute = false;
pi.RedirectStandardOutput = true;
pi.Arguments = "www.google.com";
pi.WorkingDirectory = "C:\\windows\\system32";
//this for nt* computers
pi.FileName = "ping";
p.StartInfo = pi;
p.Start();
System.IO.StreamReader sr = p.StandardOutput;
System.Text.StringBuilder sb = new System.Text.StringBuilder("");
int input = sr.Read();
while (input != -1)
{
sb.Append((char) input);
input = sr.Read();
}
MessageBox.Show(sb.ToString());

I hope this helps,

Cor
Nov 21 '05 #2
Yes thanks, had not thought about using the command prompt ping in this way!

thanks
"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:Ox**************@TK2MSFTNGP10.phx.gbl...
Adrian,

Almost all my samples are in VBNet code, this one I have only in C#, can
you use this.
(at least 80% is almost exactly the same in VBNet)
Process p = new Process();
ProcessStartInfo pi = new ProcessStartInfo();
pi.UseShellExecute = false;
pi.RedirectStandardOutput = true;
pi.Arguments = "www.google.com";
pi.WorkingDirectory = "C:\\windows\\system32";
//this for nt* computers
pi.FileName = "ping";
p.StartInfo = pi;
p.Start();
System.IO.StreamReader sr = p.StandardOutput;
System.Text.StringBuilder sb = new System.Text.StringBuilder("");
int input = sr.Read();
while (input != -1)
{
sb.Append((char) input);
input = sr.Read();
}
MessageBox.Show(sb.ToString());

I hope this helps,

Cor

Nov 21 '05 #3

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

Similar topics

1
4797
by: carramba | last post by:
Hi! Iam runing php on win32.. and Iam wondering if there is enyposibility to run tracert in php? if yes how should I do it? -- just keep swiming
1
7851
by: Mike Mallory | last post by:
Can Java perform two pings at one time and display the best ping time with the best result? Also, can Java perform two trace routes at one time and display the trace with the fewest hops? ...
1
2200
by: Paul Bergson | last post by:
I need to code a tracert function from an asp page. I can write some asp but I'm saddled with notepad as my development suite. Any pointers on getting a tracert type function from within asp? ...
2
2336
by: Kishan Hathiwala | last post by:
how do i make tracert command in .net without using 3rd party software?
7
6529
by: Linus Cohen | last post by:
Hi all, I'm a newbie to python and programming in general, so I wanted a simple project to start off. What I'm trying to do here is write a python command-line ping program, much like the Unix and...
0
1243
by: whitethomas12 | last post by:
Hi, I currently have some basic code that allows me to run the tracert command through VB.NET and it also updates my database based on the results. I was wondering if someone can help me find...
2
2006
by: whitethomas12 | last post by:
Hi, I currently have some basic code that allows me to run the tracert command through VB.NET and it also updates my database based on the results. I was wondering if someone can help me...
0
1277
by: Nick Stinemates | last post by:
On Tue, Apr 15, 2008 at 07:24:05AM -0700, shawn s wrote: I love that you call the users of your app retards :) That rocks! ping runs forever. tracert doesnt. try: -- Nick Stinemates...
1
4832
by: Gabriel Genellina | last post by:
En Tue, 30 Sep 2008 03:53:21 -0300, cindy jones <mailcindy@gmail.com> escribió: Use the subprocess module: import subprocess host = 'www.microsoft.com' p = subprocess.Popen(,...
0
7128
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,...
0
7169
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
6892
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
7385
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
5467
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,...
1
4917
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...
0
3096
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
3088
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
294
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...

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.