G
Guest
I am developing an application which will allow me to automatically sign into
an external website. I can currently do a screen scrape using
HTTPWEBREQUEST. However I want to just redirect to the external site. No
need to pull back any data.
Here is the code I am using.
Dim encoding As ASCIIEncoding = New ASCIIEncoding
Dim myParams As String = "AccessID=" & sUserID & "&Password=" &
sPassword
Dim data As Byte() = encoding.GetBytes(myParams)
Dim LOGIN_URL As String =
"https://www.blahblan.com/blah/blah.asp?WCE=RemoteLogon&IRL=T"
Dim WebRequest As HttpWebRequest =
CType(WebRequest.Create(LOGIN_URL), HttpWebRequest)
WebRequest.Method = "POST"
WebRequest.ContentLength = myParams.Length
WebRequest.ContentType = "application/x-www-form-urlencoded"
Dim myWriter As StreamWriter = New
StreamWriter(WebRequest.GetRequestStream())
myWriter.Write(myParams)
myWriter.Close()
At that point I would usually pull back the responsestream, but now I just
want to redirect to that website. I have tried appending the paramaters to
url to create a querystring, but that does not seem to work. I don't know
why as I don't have control over the external application.
Any thoughts?
Thanks
an external website. I can currently do a screen scrape using
HTTPWEBREQUEST. However I want to just redirect to the external site. No
need to pull back any data.
Here is the code I am using.
Dim encoding As ASCIIEncoding = New ASCIIEncoding
Dim myParams As String = "AccessID=" & sUserID & "&Password=" &
sPassword
Dim data As Byte() = encoding.GetBytes(myParams)
Dim LOGIN_URL As String =
"https://www.blahblan.com/blah/blah.asp?WCE=RemoteLogon&IRL=T"
Dim WebRequest As HttpWebRequest =
CType(WebRequest.Create(LOGIN_URL), HttpWebRequest)
WebRequest.Method = "POST"
WebRequest.ContentLength = myParams.Length
WebRequest.ContentType = "application/x-www-form-urlencoded"
Dim myWriter As StreamWriter = New
StreamWriter(WebRequest.GetRequestStream())
myWriter.Write(myParams)
myWriter.Close()
At that point I would usually pull back the responsestream, but now I just
want to redirect to that website. I have tried appending the paramaters to
url to create a querystring, but that does not seem to work. I don't know
why as I don't have control over the external application.
Any thoughts?
Thanks