SunQuest
           Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old August 24th, 2003, 01:14 AM
Curtis Curtis is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 7 Curtis User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > How do I use Post Data command properly


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway