|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
How do I use Post Data command properly
I want to navigate to a web site and automatically enter the username and password on it using the Postdata command. The VB6 code below results in the web error screen that says:
This page cannot be displayed because the page address is incorrect. HTTP 405 - resource not allowed. If I modify the last line of code to WB1.Navigate URL, flags, targetframe , it navigates to the correct web site, but of course doesn’t enter the user name or password 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 |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > How do I use Post Data command properly |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|