Auto-login to winkflash.com using WinHttpRequest

Can someone help me write a script, using VB6, to auto-login to winkflash.com?

I need to use WinHttpRequest as follows, for this app:

    Dim htpRequest As WinHttp.WinHttpRequest
    Set htpRequest = New WinHttp.WinHttpRequest

I would tell you everything I've tried, but why muddy the water?
hrolsonsAsked:
Who is Participating?
 
JezWaltersConnect With a Mentor Commented:
This works for me (though I'm using VBA, so you might have to tweak it slightly):
Const WEBSITE As String = "http://www.winkflash.com/photo/signin.aspx"
Const USERID As String = "UserName"
Const PASSWORD As String = "Password"

Dim htpRequest As WinHttp.WinHttpRequest

Set htpRequest = New WinHttp.WinHttpRequest
htpRequest.Open "POST", WEBSITE, False   ' Synchronously
htpRequest.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded"
htpRequest.Send "__VIEWSTATE=%2FwEPDwUJOTk0MjUzNjUwD2QWAgIDD2QWAgIBDw8WAh4LTmF2aWdhdGVVcmwFC3NpZ251cC5hc3B4ZGQYAQUeX19Db250cm9sc1JlcXVpcmVQb3N0QmFja0tleV9fFgEFC2Noa1JlbWVtYmVy6e5Vs%2BpiC56sIiBjrkn4HfS56wI%3D" & _
                "&__EVENTVALIDATION=%2FwEWBwLXz7LSBgLi%2BtIuAuv3gd4CAv2gg9wGAvK94JEPAoznisYGAtHnkYkOkrqdf4hn3msK%2Ba5taAY0gMoCpN8%3D&siteid=1" & _
                "&userid=" & USERID & _
                "&password=" & PASSWORD & _
                "&Button1=Log+In"
Debug.Print htpRequest.ResponseText

Open in new window

0
 
JezWaltersCommented:
0
 
JezWaltersCommented:
The __VIEWSTATE and __EVENTVALIDATION parameter values are entirely specific to the winkflash website, so you'd have to contact them for their precise meaning - but you can't log in without them.

Let me know if you'd like me to take you through the steps I used to figure this out!  :-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.