Go Back   Computer Forums > General Computing > Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 09-30-2003, 11:21 AM   #1
Beta Member
 
Join Date: Sep 2003
Posts: 1
Smile i want to store PING status in VB or VC

Hi, I am totally new to this forum. I want to develop program that can store ping command status in text file, like link is up or down only at particular time interval in VB or VC

plz help me
__________________

himanshu is offline   Reply With Quote
Old 09-30-2003, 12:07 PM   #2
Site Team
 
David Lindon's Avatar
 
Join Date: Dec 2002
Posts: 15,233
Default Re: i want to store PING status in VB or VC

Hi himanshu, It seems very simple what you want to do but unfortunately, I don't know VB. Sorry I can't be of any more help.
__________________

__________________
[url=http://www.LNXPS.NET]LNXPS.NET - The XPS Library]
David Lindon is offline   Reply With Quote
Old 10-19-2003, 06:00 PM   #3
Baseband Member
 
Join Date: Oct 2003
Posts: 25
Default Re: i want to store PING status in VB or VC

this should get you started (its off something else i made, in which i modded some other code)


Public Function obtainip() As String
On Error GoTo errormsg

If ipopt = True Then
ipaddress = CInt(iptxt1.Text) & "." & CInt(iptxt2.Text) & "." & CInt(iptxt3.Text) & "." & CInt(iptxt4.Text)
obtainip = ipaddress
'Determine the class of the ip address
If CInt(iptxt1.Text) < 127 Then
classlbl.Caption = "Class A IP"
End If

If CInt(iptxt1.Text) = 127 Then
classlbl.Caption = "Loopback Address"
End If

If CInt(iptxt1.Text) > 127 And CInt(iptxt1.Text) < 192 Then
classlbl.Caption = "Class B IP"
End If

If CInt(iptxt1.Text) > 191 And CInt(iptxt1.Text) < 224 Then
classlbl.Caption = "Class C IP"
End If
Else
obtainip = urltxt.Text
End If

Exit Function
errormsg:
MsgBox ("Not a valid input - Check internet connection too")
End Function



Private Sub pngcmd_Click()
ReadL.Text = ""
Dim shlcmd, comstring, IP, outpath As String

IP = obtainip
outpath = App.Path & "\ping.txt" 'Can be whereever you want
DoEvents
comstring = "command.com /c ping -a " & IP & " > " & outpath
shlcmd = Shell(comstring, vbHide)

'MsgBox ("Output has been saved to " & outpath & vbCrLf & "(Local Path)")
Timer2.Interval = 12000
stat1.Caption = "Loading......"
End Sub
__________________
Security Specialist
Cheap Software upgrades PM ME :D
Steveswaldo is offline   Reply With Quote
Old 10-20-2003, 03:03 AM   #4
Site Team
 
David Lindon's Avatar
 
Join Date: Dec 2002
Posts: 15,233
Default Re: i want to store PING status in VB or VC

Thanks steve.
__________________
[url=http://www.LNXPS.NET]LNXPS.NET - The XPS Library]
David Lindon is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 09:36 AM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0