Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27443

VS 2010 help login into my bank without forms

$
0
0
i would like some help getting something like this working theres a lot i dont understand but this is what i have so far
im trying to get it to send post data to m.regions.com to login and display the content of the account summery page that is brought up automatically and display it with msgbox() for now
any and all help is greatly appreciated this has been driving me crazy because i cant get it to login
Code:

Imports System.Net
Imports System.IO
Imports System.Text
Imports System.Text.RegularExpressions
Imports System.ComponentModel
Imports System.Threading
Module Module1
    Dim logincookie As CookieContainer
    Dim html As String = "still running"
    Sub Main()


        Dim username As String = "Username"
        Dim password As String = "password"


        Dim postData As String = "OnlineID: " + username + "&Password:" + password 'have no clue how this is formatted
        Dim tempcookies As New CookieContainer
        Dim encoding As New UTF8Encoding
        Dim bytedata As Byte() = encoding.GetBytes(postData)

        Dim postReq As HttpWebRequest = DirectCast(WebRequest.Create("https://m.regions.com/mobile"), HttpWebRequest)
        postReq.Method = "POST"
        postReq.KeepAlive = True
        postReq.CookieContainer = tempcookies
        postReq.ContentType = "application/x-ww-form-urlencoded"
        postReq.Referer = "https://m.regions.com/mobile"
        postReq.UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20100101 Firefox/11.0"
        postReq.ContentLength = bytedata.Length

        Dim postReqStream As Stream = postReq.GetRequestStream()
        postReqStream.Write(bytedata, 0, bytedata.Length)
        postReqStream.Close()
        Dim postResponse As HttpWebResponse

        postResponse = DirectCast(postReq.GetResponse(), HttpWebResponse)
        tempcookies.Add(postResponse.Cookies)
        logincookie = tempcookies

        Dim matchCount As Integer = 0

        Dim request As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create("https://m.regions.com/mobile")
        request.CookieContainer = logincookie
        Dim response As System.Net.HttpWebResponse = request.GetResponse
        Dim reader As System.IO.StreamReader = New System.IO.StreamReader(response.GetResponseStream())


        html = reader.ReadToEnd
        MsgBox(html)
    End Sub

End Module


Viewing all articles
Browse latest Browse all 27443

Latest Images

Trending Articles



Latest Images

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