473,564 Members | 2,758 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 4042
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();
ProcessStartInf o pi = new ProcessStartInf o();
pi.UseShellExec ute = false;
pi.RedirectStan dardOutput = true;
pi.Arguments = "www.google.com ";
pi.WorkingDirec tory = "C:\\windows\\s ystem32";
//this for nt* computers
pi.FileName = "ping";
p.StartInfo = pi;
p.Start();
System.IO.Strea mReader sr = p.StandardOutpu t;
System.Text.Str ingBuilder sb = new System.Text.Str ingBuilder("");
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******** ******@TK2MSFTN GP10.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();
ProcessStartInf o pi = new ProcessStartInf o();
pi.UseShellExec ute = false;
pi.RedirectStan dardOutput = true;
pi.Arguments = "www.google.com ";
pi.WorkingDirec tory = "C:\\windows\\s ystem32";
//this for nt* computers
pi.FileName = "ping";
p.StartInfo = pi;
p.Start();
System.IO.Strea mReader sr = p.StandardOutpu t;
System.Text.Str ingBuilder sb = new System.Text.Str ingBuilder("");
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
4806
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
7855
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? Thank you for your help. Mike
1
2205
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? -- Thanks
2
2346
by: Kishan Hathiwala | last post by:
how do i make tracert command in .net without using 3rd party software?
7
6535
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 Windows ping programs. I've got this much worked out already: class ping def PING(IP, pings, size): and that's where I stop, because I...
0
1263
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 a way that I can used my code to run tracert on mutiple instances at the same time. The following is my current code.
2
2015
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 a way that I can used my code to run tracert on mutiple instances at the same time. The following is my current code.
0
1281
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 (nick@stinemates.org)
1
4839
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(, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
0
7583
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...
0
7888
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. ...
0
8106
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...
0
6255
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...
0
5213
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...
0
3643
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...
1
2082
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
1
1200
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
924
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...

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.