473,327 Members | 2,065 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Vb 2005

Hi,

I wrote a program using visual studio 2005 that checks to make sure a certain web site is up and running by sending loggin info to the html text boxes on the site. (i.e. username and password). I can send a string to the username box no problem and it takes me to another page requiring me for a password. The problem occurs when I am attempting to send a string to the 'passsword' text box becasue I can not get focus. I believe I am having difficulty because it is in an <IFRAME> and I am not sure how to parse it. I have a temporary fix (sending keys to the text box) but this does not work when the computer is locked(My program is running every 10 minutes). Does anyone have any idea on how I can set focus inside the 'password' text box?

Thanks.
Rob
Jun 27 '07 #1
3 988
danp129
323 Expert 256MB
Hi,

I wrote a program using visual studio 2005 that checks to make sure a certain web site is up and running by sending loggin info to the html text boxes on the site. (i.e. username and password). I can send a string to the username box no problem and it takes me to another page requiring me for a password. The problem occurs when I am attempting to send a string to the 'passsword' text box becasue I can not get focus. I believe I am having difficulty because it is in an <IFRAME> and I am not sure how to parse it. I have a temporary fix (sending keys to the text box) but this does not work when the computer is locked(My program is running every 10 minutes). Does anyone have any idea on how I can set focus inside the 'password' text box?

Thanks.
Rob
I would just do this and not mess with a browser object or an instance of IE:

Expand|Select|Wrap|Line Numbers
  1.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  2.         Dim oXMLHTTP
  3.         oXMLHTTP = CreateObject("Microsoft.XMLHTTP")
  4.  
  5.         oXMLHTTP.Open("POST", "http://www.yourwebsite.com/logon.asp", False)
  6.         oXMLHTTP.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
  7.         oXMLHTTP.Send("username=MyUsername&password=MyPassword")
  8.         Debug.Print(oXMLHTTP.responseText)
  9.  
  10.         oXMLHTTP = Nothing
  11.  
  12.     End Sub
Jun 29 '07 #2
Dan,

Thank you for your reply! I was able to determine the name of the 'password' textbox. However, I still can not set focus to it. The page starts with focus in one frame and the 'password' box is in another frame on the same page. I am not sure how to get control in the other frame. Any suggestions?

Thanks in advance.

Rob
Jul 5 '07 #3
danp129
323 Expert 256MB
Do you get an error of access denied? You cannot programatically access a frame (or iframe) that is loaded from a domain different than where the framset or parent document (in event of iframe) was loaded (i.e. what's listed in the url). It might be possible if one or both domains were trusted sites if this is your issue, but not sure.

If you can't figure it out, make some webpages that replicates what you're attempting to login to and post the URL.
Jul 6 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.