|
-
Nov 20th, 1999, 07:55 AM
#1
Thread Starter
New Member
hi.
i need to make a program that i think is simple, but i dont have any knowlege of vb. in DOS, if you type the following line,
ping -f -l 500 www.microsoft.com
it pings www.microsoft.com using a mtu of 500. i need a vb app that has two textboxes, and a command button. in onw textbox, you put the MTU number, in the other you put the URL to ping. then you hit the button.
the button opens a DOS prompt, and assembles the message above, and then runs it. it will then return all the ping info in the DOS pompt. If someone wants to show me how to write this program, or just make it, and send it to me. my email is [email protected]
if you make the app, please send it to that address.
thanks. its probably simple, but im retarded so...
-
Nov 21st, 1999, 12:56 PM
#2
Guru
Let's say you put the number in Text1, the address in Text2 and then click Command1 to ping. Use this code:
Private Sub Command1_Click()
Call Shell("ping -f -l " & Val(Text1.Text) & " " & Text2.Text, vbNormalFocus)
End Sub
------------------
Yonatan
Teenage Programmer
E-Mail: [email protected]
ICQ: 19552879
AIM: RYoni69
-
Nov 25th, 1999, 01:00 PM
#3
Thread Starter
New Member
thank you very much. that works quite well. i only have one problem. when the DOS console is done working, it closes instantly, before you have a chance to look at the results. How can i make the DOS window not close?
-
Nov 25th, 1999, 08:43 PM
#4
Hyperactive Member
You have a number of options
you can redirect the output to a text file and then use edit to view
eg (not tested)
Private Sub Command1_Click()
Call Shell("ping -f -l " & Val(Text1.Text) & " " & Text2.Text & "> c:\data.txt", vbNormalFocus)
End Sub
call shell("edit c:\data.txt")
or you can write the command to a bat file and put a pause after it.....
any more questions please do not hesitate to contact me.
[email protected]
Galway
Ireland
-
Nov 25th, 1999, 08:46 PM
#5
Hyperactive Member
Sorry in wrong place
you can change the vbNormalFoxus as well I'm sure look at the help shell constants for windowsize etc.
Private Sub Command1_Click()
Call Shell("ping -f -l " & Val(Text1.Text) & " " & Text2.Text, vbNormalFocus)
call shetll("edit c:\data.txt", vbNormalFocus)
End Sub
-
Nov 25th, 1999, 09:20 PM
#6
Or try this:
Call Shell(Environ("ComSpec") & " /k " & "ping -f -l " & Val(Text1.Text) & " " & Text2.Text, vbNormalFocus)
Good luck!
------------------
Joacim Andersson
[email protected]
[email protected]
www.YellowBlazer.com
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|