Click to See Complete Forum and Search --> : -=Internet Monitor=-
MIB
August 30th, 2001, 02:48 AM
Hello
I am trying to use VB6 to write an application which will monitor internet site is Online or Offline (I can't use ping IP becasue of secure reason)
I need to find the way which will find the field box for you on IE5.5 then insert Data then submit it.
For example,
1. Find UserName textBox on broswer then insert Data
2. Find Password textBOx on Browser then insert Data
3. Cick submit buttom
From Step 1 to 3 must be automatically, no manual clicking.
I am trying to use Microsoft HTML Object library & Microsoft Internet Contorls. But didn't get it work.
Any suggestion??
Please reply on this Forum or send me solution in MIB426@hotmail.com
Thanks ALL
berta
August 30th, 2001, 03:03 AM
include internet trasfer control 6.0
private Function Command1_Click() as Boolean
on error GoTo err_handle
Dim idx as Long
m_LastHeaderOnTest = ""
'Form1.Inet.RequestTimeout = 5000
If (frmocxSupport.Inet.OpenURL(m_wwwAddr) = "") then _
Err.Raise vbObjectError + 1001, , "OpenUrl failed"
m_LastHeaderOnTest = frmocxSupport.Inet.GetHeader
If InStr(1, m_LastHeaderOnTest, "HTTP/1.1 200 OK") = 0 then
idx = InStr(1, m_LastHeaderOnTest, vbCrLf)
If idx = 0 then
Err.Raise vbObjectError + 1002, , "Invalid Header"
else
Err.Raise vbObjectError + 1003, , mid$(m_LastHeaderOnTest, 1, idx - 1)
End If
End If
IService_TestConnection = true
on error GoTo 0
Exit Function
err_handle:
m_LastErrorOnTest = Err.Description
on error GoTo 0
IService_TestConnection = false
End Function
hi,brt
<center>
<HR width=80%>
<img src='http://web.tiscali.it/bertaplanet/images/bertaplanet.gif'>
</center>
berta
August 30th, 2001, 03:12 AM
public Function TestConnection(byval wwwAddr a string,byref header as string) as Boolean
on error GoTo err_handle
Dim idx as Long
Header = ""
'Form1.Inet.RequestTimeout = 5000
If (myForm.Inet.OpenURL(wwwAddr) = "") then _
Err.Raise vbObjectError + 1001, , "OpenUrl failed"
Headder = MyForm.Inet.GetHeader
If InStr(1, Header, "HTTP/1.1 200 OK") = 0 then
idx = InStr(1, Header, vbCrLf)
If idx = 0 then
Err.Raise vbObjectError + 1002, , "Invalid Header"
else
Err.Raise vbObjectError + 1003, , mid$(Header, 1, idx - 1)
End If
End If
TestConnection = true
on error GoTo 0
Exit Function
err_handle:
debug.print Err.Description
on error GoTo 0
TestConnection = false
End Function
<center>
<HR width=80%>
<img src='http://web.tiscali.it/bertaplanet/images/bertaplanet.gif'>
</center>
berta
August 30th, 2001, 04:20 AM
why U don't use query string?
example u have an html page with UserName and Password then http://myserver/mypage?username=myuser&password=mypassword
hi,brt
<center>
<HR width=80%>
<img src='http://web.tiscali.it/bertaplanet/images/bertaplanet.gif'>
</center>
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.