|
-
August 30th, 2001, 02:48 AM
#1
-=Internet Monitor=-
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 [email protected]
Thanks ALL
-
August 30th, 2001, 03:03 AM
#2
Re: -=Internet Monitor=-
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/im...ertaplanet.gif'>
</center>
-
August 30th, 2001, 03:12 AM
#3
Re: -=Internet Monitor=-
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/im...ertaplanet.gif'>
</center>
-
August 30th, 2001, 04:20 AM
#4
Re: -=Internet Monitor=-
why U don't use query string?
example u have an html page with UserName and Password then http://myserver/mypage?username=myus...ord=mypassword
hi,brt
<center>
<HR width=80%>
<img src='http://web.tiscali.it/bertaplanet/im...ertaplanet.gif'>
</center>
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
|