|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I want to automatically log a user onto our web site and enter their name and password for them. The VB6 code below will navigate to the website if I make the last line of this sample code as:
WB1.Navigate URL, flags, targetframe Unfortunately, when I include the Postdata in the Navigate line it won't enter their username and password onto the website. What am I doing wrong with the PostData command (or any other bad things I've done in the code)? Thanks for any help with this one. Dim URL As String Dim flags As Long Dim targetframe As String Dim PostData() As Byte Dim headers As String Dim cPW As String Dim cname As String Dim myPW As String Dim myname As String Dim cseparator As String * 1 cseparator = "&" headers = "Content-Type: application/x-www-form-urlencoded" & vbCrLf cname = "userID" 'website name of Name field cPW = "password" 'website name of PW field myname = "WA000003" ‘login name myPW = "audit” ‘login password URL = http://208.25.210.72/webagentaccessdemo/WebAgent.htm PostData = cname & "=" & myname & cseparator & cPW & "=" & myPW flags = 0 targetframe = "" PostData = StrConv(PostData, vbFromUnicode) WB1.Height = Me.ScaleHeight WB1.Width = Me.ScaleWidth WB1.Left = 0 WB1.Navigate URL, flags, targetframe, PostData, headers |
|
#2
|
||||
|
||||
|
What do you mean by "doesn't work"?? Does it give you an error or anything?
|
|
#3
|
|||
|
|||
|
Thanks for the quick response. I'm sorry but this is my first technical post and I forgot to give the error message.
In the last line of my code above, the Navigate command, if I remove everything after Targetframe, the browser successfully goes to the correct web site. If I put back in , PostData, headers at the end of the Navigate command, it gives me the screen: This page cannot be displayed because the page address is incorrect. HTTP 405 - resource not allowed. |
|
#4
|
|||
|
|||
|
Does anyone have a clue on this one? It sure seems like it should work OK, but it doesn't. Is there any alternative approach you'd suggest?
|
![]() |
| Viewing: Dev Shed Forums > Other > Beginner Programming > My PostData command doesn't work |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|