Auto-login to using WinHttpRequest

Can someone help me write a script, using VB6, to auto-login to

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?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

This works for me (though I'm using VBA, so you might have to tweak it slightly):
Const WEBSITE As String = ""
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 & _
Debug.Print htpRequest.ResponseText

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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!  :-)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.