I'm in the process of converting over old coding to vb2005. The coding should login to the site, wait till execution is complete, then post to the post link page. I have some vb2005 coding below and under that my old working vb6 coding. so you can see from vb6 what i'm trying to do in vb2005
VB Code:
Dim web As New System.Net.WebClient() Dim strPostData As String strPostData = "login_form_submit=1&admin=" + txtlogin.Text + "&password=" + txtPass.Text web.Headers.Add("Content-Type", "application/x-www-form-urlencoded") web.Headers.Add("Referer", "http://www.domain.com") Dim d As Byte() = System.Text.Encoding.ASCII.GetBytes(strPostData) web.UploadData("http://www.domain.com/index.html", "POST", d) [B]'Code Needed: Wait till execution of (login) is complete. 'Code Needed: Goto and Open this page [url]http://www.domain.com/admin/updates.html[/url] 'Code Needed: Wait till execution of webpage is complete.[/B]
this is what i use to do in vb6
VB Code:
Dim nUrl, strPostData As String strPostData = "login_form_submit=1&admin=" + txtlogin.Text + "&password=" + txtPass.Text Inet.Execute "http://www.domain.com/index.html", "POST", _ strPostData, "Content-Type: application/x-www-form-urlencoded" & vbCrLf _ "Referer: http://www.domain.com" & vbCrLf Do On Error GoTo Err: DoEvents Loop Until Inet.StillExecuting = False nUrl = "http://admin.domain.com/?OPERATION=1&ADMIN=" Inet.OpenURL nUrl + txtSN.Text + "&SUBJECT=" + txtSub.Text _ + "&MESSAGE=" + txtmsg.Text + "&POST.x=46&POST.y=5" Do On Error GoTo Err: DoEvents Loop Until Inet.StillExecuting = False Msgbox "Done!"




Reply With Quote