This is an AutoIT script for anyone who wants to automate their login to the Sherston ICT website content.
Code:#include <IE.au3> $sURL = "http://www.sherston.com/Login/Default.aspx?RedirectPath=/Default.aspx" $sUserName = "USERNAME" $sPassword = "PASSWORD" $sForm = "aspnetForm" $sUserfield = 'ctl00$PageContent$Login1$txtUsername' $sPassfield = 'ctl00$PageContent$Login1$txtPassword' $oTimeout = 5000 _IELoadWaitTimeout($oTimeOut) _IEErrorHandlerRegister() $oIE = _IECreate($sURL) _IELoadWait($oIE) $oForm = _IEFormGetObjByName($oIE, $sForm) $oUserName = _IEFormElementGetObjByName($oForm, $sUserfield) $oPassword = _IEFormElementGetObjByName($oForm, $sPassfield) _IEFormElementSetValue($oUserName, $sUserName) _IEFormElementSetValue($oPassword, $sPassword) _IELinkClickByIndex($oForm, 5) _IELoadWait($oIE, $oTimeout, $oTimeout) _IENavigate($oIE, "http://www.sherston.com/crystal/default.aspx") _IELoadWait($oIE, $oTimeout, $oTimeout) _IELinkClickByText($oIE, "Launch")
Their website code is quite frankly showing every example of what NOT to do with HTML and code with truly awful accessibility fubars but at time of writing this code will write and I'll update as/when I notice any changes that require it.
To use this simply edit the username/password variables to suit your school and then upload the resultant executable to a shared space on your server.. Create a shortcut to that and deploy to your users and it'll handle the login fine... (It even works if you are logged in already).
Adjust the timeout to get it to wait longer or run quicker according to your system.
Hope it helps...



LinkBack URL
About LinkBacks
Reply With Quote







