Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 42367

WebRequest Click Button

$
0
0
can you click a button on a website using webrequest ??? and if so then how is it similar to this login function ?

PHP Code:

    Function Login(ByVal Site As StringByVal Reffer As StringByRef Output As CookieContainer)

        
Dim postData As String Reffer
        Dim tempCookies 
As New CookieContainer
        Dim encoding 
As New UTF8Encoding
        Dim byteData 
As Byte() = encoding.GetBytes(postData)

        
Dim postReq As HttpWebRequest DirectCast(WebRequest.Create(Site), HttpWebRequest)
        
postReq.Method "POST"
        
postReq.KeepAlive True
        postReq
.CookieContainer tempCookies
        postReq
.ContentType "application/x-www-form-urlencoded"
        
postReq.Referer Site
        postReq
.UserAgent "Mozilla/5.0 (compatible; MSIE 10.6; Windows NT 6.1; Trident/5.0; InfoPath.2; SLCC1; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 2.0.50727) 3gpp-gba UNTRUSTED/1.0"
        
postReq.ContentLength byteData.Length

        Dim postreqstream 
As Stream postReq.GetRequestStream()
        
postreqstream.Write(byteData0byteData.Length)
        
postreqstream.Close()
        
Dim postresponse As HttpWebResponse

        postresponse 
DirectCast(postReq.GetResponse(), HttpWebResponse)
        
tempCookies.Add(postresponse.Cookies)
        
Output tempCookies
        
Return 0
    End 
Function 

Thanks in advance

Viewing all articles
Browse latest Browse all 42367

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>