Posting data to an ASP form?

I need to write and agent that logs onto an ASP page and then uploads a file to it.I have written code using Microsoft.xmlHTTP to try and do this but am failing. The site is secured by a username, password and an additional user ID field.

The url is https://219.99.159.59/hws%20web%20site2/LoginMenu/Login.aspx

So, I need to populate the following fields on the login screen.

-txt_Dist_Code

-txt_UserID

-txt_Password

How do I go about doing this???

Logging in is only the first step.

The next step is to upload a file to a file upload control on an ASP form and then submit it.

This is the code that I have written so far…

HELP!!!

Sub Initialize

URL = "https://219.99.159.59/hws%20web%20site2/LoginMenu/Login.aspx"



Set xmlhttp = CreateObject("Microsoft.xmlHTTP")

Call xmlhttp.open("POST",URL,False,usr,pwd)



Call xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")



'textToSend = ""

Call xmlhttp.send (textToSend)



http_post = xmlhttp.responseText '---> This is the response that is received based on the post...

Msgbox http_post



'---> Cleanup...

Set xmlhttp = Nothing

End Sub