Jump to content



Photo

winhttp login form help


  • This topic is locked This topic is locked
2 replies to this topic

#1 NTBM

NTBM

    Seeker

  • Active Members
  • 29 posts

Posted 24 April 2012 - 07:51 AM

I am trying to write an app to auto login to a website and then send commands to it.
The website is an internal to an ip controlled relay box (allows switching devices on/off via website)

i have done it with a gui that calls an ie session however this is ugle and would like to do it outside of ie.

here is the html of the login screen
Plain Text         
<title>IP Family</title> <center> <p align="left"><font color="#0033ff" size="5" face="Verdana, Arial, Helvetica, sans-serif"><em><strong><font size="4">Aviosys       Inc.</font></strong></em></font></p> <p align="left"><font size="+1" face="Georgia,Arial"><font color="#0000ff" size="+2" face="Verdana, Arial, Helvetica, sans-serif"><strong><font color="#000000" size="4" face="Arial"><b>Welcom to IP Family       WebControl</b></font></strong></font></font></p> <table border="0" width="392" bgColor="#dfdfdf" align="left"> <tbody><tr> <td noWrap=""> <form method="post" name="login" action="/tgi/login.tgi"> <center> <table cellSpacing="0" cellPadding="10" width="96%" align="center" NAME="myTable"> <tbody><tr vAlign="top" align="left"> <td colSpan="2"><font size="2" face="Arial, Helvetica, sans-serif">Please enter User name &amp; Password. (maximum = 8)</font></td></tr> <tr vAlign="top" align="left"> <td><font face="Verdana,Arial"><font size="-1">User Name</font></font></td> <td><input name="Username" maxLength="32" value="admin" size="32" type="text"></td></tr> <tr vAlign="top" align="left"> <td height="46"><font face="Verdana,Arial"><font size="-1">Password</font></font></td> <td height="46"><input name="Password" maxLength="32" value="" size="32" type="password"></td></tr> <tr vAlign="top" align="left"> <td></td> <td> <p align="center"><input onclick="calcResponse(); return false;" name="Submitbtn" value="&#9;  OK&#9;  " type="Submit">        <input onclick="document.login.Username.value='';document.login.Password.value=''" name="Cancel" value="   Cancel   " type="button"> </p></td></tr></tbody></table></center> <input name="Challenge" value="k7n....." type="hidden"> <input name="Response" value="" type="hidden"> </form></td></tr> <tr> <td> <p align="right"><a href="<a href='http://www.aviosys.com' class='bbc_url' title='External link' rel='nofollow external'>http://www.aviosys.com"</a> target="_blank">www.aviosys.com</a></p></td></tr></tbody></table> </center>


and here is the code i have so far

<snip>

this results in a failed login screen, which i think is due to the shallange field but am unsure where to go from here?

Any advise would be great.

Cheers

Edited by Melba23, 24 April 2012 - 08:02 AM.
Code removed






#2 water

water

    ?

  • MVPs
  • 10,684 posts

Posted 24 April 2012 - 07:53 AM

I am trying to write an app to auto login to a website

Please make sure to read the forum rules. Especially the part about login automation: SPAM tools including instant messenger or forum auto-posters. This includes forum or site auto-login methods.

UDFs:

Active Directory (2012-10-12 - Version 1.3.0.0 released) - Download - General Help & Support - Example Scripts - Wiki

OutlookEX (2012-10-07 - Version 0.9.0.0 released) - Download - General Help & Support - Example Scripts - Wiki

ExcelChart (2013-01-21 - Version 0.3.1.1 released) - Download - General Help & Support - Example Scripts

WordEX (2012-12-29 - Version 1.3 released) - Download

ExcelEX (2013-05-11 - Alpha 4 released) - Download


#3 Melba23

Melba23

    Yes, me!

  • Moderators
  • 15,343 posts

Posted 24 April 2012 - 08:01 AM

NTBM,

Please read and follow the Forum rules to which water linked. ;)

M23
StringSize - Automatically size controls to fit text - ExtMsgBox - A user customisable replacement for MsgBox

Toast - Small GUIs which pop out of the Systray - Marquee - Scrolling tickertape GUIs

Scrollbars - Automatically sized scrollbars with a single command - GUIFrame - Subdivide GUIs into many adjustable frames

GUIExtender - Extend and retract multiple sections within a GUI - NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes

ChooseFileFolder - Single and multiple selections from specified path tree structure - - Notify - Small notifications on the edge of the display

RecFileListToArray - An alternative to _FileListToArray with user-defined include/exclude masks, maximum recursion level, sorting and displayed path options

GUIListViewEx - Insert, delete, move, drag and sort ListView items





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users