Jump to content

[Question] Autoit login using WinHttp Error


Recommended Posts

#Include <WinHttp.au3>
$session = _WinHttpOpen("User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0")
$connect = _WinHttpConnect($session, "up.4share.vn")
$html = _WinHttpSimpleRequest($connect, "POST", "?control=login HTTP/1.1", "up.4share.vn", "inputUserName=vvhite&inputPassword=123123")
FileWrite("Server 4Share Menu.html", $html)
_WinHttpCloseHandle($connect)
_WinHttpCloseHandle($session)

The above code I use to log on to my account page http://up.4share.vn but it failed and the error "ERROR: Not valid control!" Please help
Thank you very much
Edited by minhlaobao
Link to comment
Share on other sites

I would go with this:

#include "WinHttp.au3"
$session = _WinHttpOpen("User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0")
$connect = _WinHttpConnect($session, "up.4share.vn")
$html = _WinHttpSimpleFormFill($connect, "?control=login", "login", "inputUserName", "vvhite", "inputPassword", "123123")
FileWrite("Server 4Share Menu.html", $html)
_WinHttpCloseHandle($connect)
_WinHttpCloseHandle($session)

♡♡♡

.

eMyvnE

Link to comment
Share on other sites

  • 8 months later...

Help Me Fix Code, Now cannot login :

#include "WinHttp.au3"
$session = _WinHttpOpen("User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0")
$connect = _WinHttpConnect($session, "up.4share.vn")
$html = _WinHttpSimpleFormFill($connect, "?control=login", "login", "inputUserName", "vvhite", "inputPassword", "123123")
FileWrite("Server 4Share Menu.html", $html)
_WinHttpCloseHandle($connect)
_WinHttpCloseHandle($session)
Link to comment
Share on other sites

This is a novice guess because I have never used the _WinHttpOpen function however it has opened my eyes to new things I can now do with autoit but wouldnt it be easier to start at the http://up.4share.vn/index/login page and then use controls for username and password?

I cannot figure out how you got "User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0". Where did you find that?

Edited by computergroove

Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...