Home > Software engineering >  VB6 login using the winhttp web site and submit questions
VB6 login using the winhttp web site and submit questions

Time:10-29

Please expert guidance, at present has written more than half but there are still problems

Account: csdntest
Password: Test1234 & lt; - note is case sensitive
it
Objective: to login
https://login.yahoo.com/config/login? . The intl=tw& The partner=& amp; The last=& amp; . src=https://bbs.csdn.net/topics/wrtch&.scrumb=0&.pd=c=R.kjIs2p2e5IjYgxHnmFvubWqw -- -- & pkg=&stepid=i&&.done=https%3a//login.yahoo.com/config/validate%3f.src=wrtch%26.pc=1164%26.scrumb=0%26.done=https%3a//login.wretch.cc/IDintegration/? Ref=% 25252 f


And enter the account number, password - & gt; Login - & gt; Blog - & gt; A new article published (old)


Above all use account and password to log in to see
Useful a webbrowser version already, just want to improve speed, is bound to use packet sending






Don't know whether I will do some referer or cookie management, this concept is not clear to me that code is completely making e | ? ? steel out
Or ask ace to join QQ
QQ: 1795544930


 


Dim LoginOoutHttpRequest $
Dim sUrl $' As String
Dim sMethod $' As String
Dim sBody 'As String
Dim sResponse $' As String


Dim UserID 'As the String' user name
Dim PassWord 'As the String' PassWord

Dim URL_Get 'As String
Dim URL_Post 'As String

Dim login_u
Dim login_challenge
Dim login_done
Dim login_pd


Dim Article_post_c
Dim Article_post_t
Dim Atricle_year
Dim Atricle_mon
Dim Atricle_day
Dim Atricle_hour
Dim Atricle_mins

LoginPostForm ()=Array (" u "and" challenge ", "done", "pd")
ArticlePostForm ()=Array (" c ", "t")

UserID="csdntest"
PassWord="Test1234"

On the Error Resume Next


URL_Get="HTTP://http://tw.rd.yahoo.com/referurl/wretch/kk/l/haha/M/logout/* http://www.wretch.cc/index/logout.php? "
url=http%3A%2F%2Ftw.yahoo.com
Call Method_GetUrl (URL_Get)


'get to log in the website of
URL_Get="HTTP://https://login.yahoo.com/config/login? . The intl=tw& The partner=& amp; The last=& amp; . src=https://bbs.csdn.net/topics/wrtch&.scrumb=0&.pd=c=R.kjIs2p2e5IjYgxHnmFvubWqw -- -- & pkg=&stepid=i&&.done=https%3a//login.yahoo.com/config/validate%3f.src=wrtch%26.pc=1164%26.scrumb=0%26.done=https%3a//login.wretch.cc/IDintegration/? Ref=% 25252 f "

Take the url source to catch '
Text12. Text=Method_GetUrl (URL_Get)


'use regular expressions to the form fields in the source of value to give out
Dim data_array As String

Data_array=LoginPostForm (0)
Login_u=XmlhttpTestRegExp (data_array, Text12. Text)

Data_array=LoginPostForm (1)
Login_challenge=XmlhttpTestRegExp (data_array, Text12. Text)


Data_array=LoginPostForm (2)
Login_done=XmlhttpTestRegExp (data_array, Text12. Text)


Data_array=LoginPostForm (3)
Login_pd=XmlhttpTestRegExp (data_array, Text12. Text)


'put out value in sBody, ready to post out

'sBody="tries=1 & amp; "Src=https://bbs.csdn.net/topics/wrtch&.md5=&.hash=&.js=&.last=&promo=&.intl=tw&.lang=zh-Hant-TW&.bypass=&.partner=&.u=& amp; Login_u & amp; "& amp; . V=0 & amp; The challenge="& amp; Login_challenge & amp; "& amp; . Yplus=& amp; . EmailCode=& amp; PKG=& amp; Stepid=i& The ev=& amp; HasMsgr=1 & amp; . ChkP=Y& . Done="& amp; Login_done & amp; "& amp; "Pd=& amp; Login_pd & amp; ". Ws=1 & amp; . The cp=0 & amp; Nr=0 & amp; Pad=3 & amp; Aad=3 & amp; The login="& amp; UserID & amp; "& amp; Passwd="& amp; The PassWord & amp; "& amp; The persistent=y& E7. Save=% % 99% % BB E5%85% A5 & amp; Passwd_raw="

SBody="tries=1 & amp; "Src=https://bbs.csdn.net/topics/wrtch&.md5=&.hash=&.js=&.last=&promo=&.intl=tw&.lang=zh-Hant-TW&.bypass=&.partner=&.u=& amp; Login_u & amp; "& amp; . V=0 & amp; The challenge="& amp; Login_challenge & amp; "& amp; . Yplus=& amp; . EmailCode=& amp; PKG=& amp; Stepid=i& The ev=& amp; HasMsgr=1 & amp; . ChkP=Y& . Done="& amp; Login_done & amp; "& amp; "Pd=& amp; Login_pd & amp; ". Ws=1 & amp; . The cp=0 & amp; Nr=0 & amp; Pad=3 & amp; Aad=3 & amp; The login="& amp; UserID & amp; "& amp; Passwd="& amp; The PassWord & amp; "& amp; The persistent=y& . Save=login & amp; Passwd_raw="

MsgBox "sBody" & amp; SBody
URL_Post="HTTP://https://login.yahoo.com/config/login? . The intl=tw& The partner=& amp; The last=& amp; . src=https://bbs.csdn.net/topics/wrtch&.scrumb=0&.pd=c=R.kjIs2p2e5IjYgxHnmFvubWqw -- -- & pkg=&stepid=i&&.done=https%3a//login.yahoo.com/config/validate%3f.src=wrtch%26.pc=1164%26.scrumb=0%26.done=https%3a//login.wretch.cc/IDintegration/? Ref=% 25252 f "
'" https://login.yahoo.com/config/login "


Call Method_PostUrl (URL_Post sBody)



'after login to post to the page
URL_Get="HTTP://http://www.wretch.cc/blog/modify.php? Blog_id=csdntest& Func=post& Htmlarea=2 & amp; Switch_editor=1
"
'the page source code to read
Text12. Text=Method_GetUrl (URL_Get)




Data_array=ArticlePostForm (0)
Article_post_c=XmlhttpTestRegExp (data_array, Text12. Text)


Data_array=ArticlePostForm (1)
Article_post_t=XmlhttpTestRegExp (data_array, Text12. Text)




Atricle_year=Year (Now)
Atricle_mon=Month (Now)
Atricle_day=Day (Now)
Atricle_hour=Hour (Now)
Atricle_mins=Minute (Now)


'will be the source of some special values of the column to read, and prepare to post out
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related