Results 1 to 3 of 3

Thread: [closed] okie..im in! now how do I nav to other neato ish?

  1. #1

    Thread Starter
    Addicted Member jalexander's Avatar
    Join Date
    Jan 2011
    Location
    Memphis, TN
    Posts
    160

    [closed] okie..im in! now how do I nav to other neato ish?

    Ok so after a few hours on google, I figured out how to login my forum website. And even search the page (after login) for "Welcome, JennVBnet" to know I logged in successfully. Now my cookies are set & I'm logged in.
    Code:
        Private Sub btnLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLogin.Click
            Dim postData As String = "username=" & txtUser.Text & "&password=" & txtPass.Text & "&remember=yes&submit=Login&action=do_login&url=http%3A%2F%2Fjennifers.forum.is.cute.org%2Findex.php"
            Dim bytes() As Byte = ASCIIEncoding.UTF8.GetBytes(postData)
            Dim postReq As HttpWebRequest = WebRequest.Create("http://jennifers.forum.is.mad.cool.0rg/member.php")
            postReq.Method = "POST"
            postReq.KeepAlive = True
            postReq.CookieContainer = mainCookie
            postReq.ContentType = "application/x-www-form-urlencoded"
            postReq.Referer = "http://jennifers.forum.is.mad.cool.0rg/index.php"
            postReq.UserAgent = "Poo/5.0 (WinGirlPower 6.1; WOW64; rv:19.0) GeekCo/20100101 FireInMySox/19.0"
            postReq.ContentLength = bytes.Length
            Dim postStream As Stream = postReq.GetRequestStream()
            postStream.Write(bytes, 0, bytes.Length)
            postStream.Close()
            Dim postResponse As HttpWebResponse
            postResponse = postReq.GetResponse()
            mainCookie.Add(postResponse.Cookies)
            Dim reader As New StreamReader(postResponse.GetResponseStream())
            Dim strSource As String = reader.ReadToEnd
            If strSource.Contains("Welcome, Jennifer") Then
                MessageBox.Show("VB ROX MY SOX :::THE CHERRY RED KOOLAID MAN SAYS...:::: OHHHH YEA!")
                Timer1.Enabled = True
            Else
                MessageBox.Show("Me so sorry, Ur WebReq KungFu is WeaK! ")
            End If
        End Sub
    ^ btw that code works, if you take out the silly non-working link jello & replace it with your own pudding

    Ok...
    So I added a timer & I guess I'm going to add a Case selection scenario. So after successful login & 30 seconds I want to surf to /PrivateMessages.php, ill look for some keywords to alert me to if I've got any PM's using
    Code:
     Dim strSource As String = reader.ReadToEnd
            If strSource.Contains("You've got # New PM's")
    etc.....

    So how do I switch from a situation where I am logging in AKA posting data to the server to simply surfing to webpages that don't require me to submit data?

    If anyone else has ever tried to learn how to do this & knows of a good forum post explaining it...or any other resource on the net. I would really appreaciate you pointing me in the right direction. Or perhaps if you are feeling incredibly generous & want to save a poor newbie 3 hours. Maybe you could find it in your incredibly righteous & generous heart..to write me simple Case Select code showing me navigating to the PM inbox, searching for a keyword, waiting 30seconds then going to the News Section (/news.php) or something like that <3... After 6 months of working with the Circa 2001 IE6 WebBrowser Control...I feel as if I've finally graduated to needing to LEARN the "RIGHT WAY" LOL

    p.s.
    does httpwebrequest actually render all of the html/links/data on a webpage..like a real webbrowser would? for instance...if i were to surf around my website with a program solely done in webreq...would my surfing actually show up in my website statistics/google analytics/type of stuff, as if i were a regular surfer? I kind of assumed it's got to be loading everything, otherwise how could i search text on the page? But i wonder if it loads javascript/css & other stuff. I'm all excited to not only figure out how to use it...but what exactly its doing & how it does it Im like a newborn baby with programming.. staring at the sky...so excited, naive & amazed..dum de dum dum! Now im all like ....WHY? WHY? HOW? WHY? HOW? HOW COME?!? HOW DOES THIS WORK? WHAT DOES THIS DO!?! LOL
    p.p.s
    Sorry for crazy long posts, I'm sure i could find a way to detail my needs without 100+ words. College & 500word essays broked me!
    I'm just so excited to learn programming I guess. It's the one thing in my life right now that makes my eyes twinkle, gets me excited & honestly the only thing that gets me out of bed in the morning. So just know that when you help me...you're seriously making my friccin day! :::background music = beck/loser::::
    #LOSER #NOLIFE #ANTI-SWAG
    Last edited by jalexander; Mar 20th, 2013 at 03:15 PM. Reason: resolved sorta kinda
    dim jenn as geek = true
    Learning ~ Visual Basic 2010 ~ in free time between college/work -
    currently looking for a 'programming buddy' / 'coder friend' / and or 'mentor'. p.m. me if you
    have ANY free time AT ALL I'm like 33% of a novice level ~ willing 2 listen/learn +
    i am totally super motivated & promise to make an effffin amazing protege!!! #swag

    | -_-_- -_-_- |
    ...W.T..F!?.....
    ||| Matter on the atomic/quantum level isn't solid or even matter at all. It can also exist in at least 2 places simultaneously (demonstrated in lab). It's position can only be established when it's actually observed. If we turn our back on it... it goes back to a wave form. History show's that every previous generation (since the beginning of time) got almost everything wrong. Then it might very well stand to reason that up is down & right can be wrong. Admit it.. our combined perception of reality is just that, we know absolutely nothing of actual reality & to think we do is simply subscribing to a "ignorance is bliss" mantra |||

  2. #2
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    Re: okie..i logged in! (webreq) yeehaw! now how do I nav to other neato ish?

    does httpwebrequest actually render all of the html/links/data on a webpage
    No. It tickles a website's tummy and asks nicely for whatever it's willing to give. In most cases where a specific response protocol isn't in place that's the source HTML so you could just carry on making web requests to the relevant pages to navigate around. If you want to actually see the page or manipulate it using VB's HTML commands you would write the source HTML to a browser document.
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

  3. #3

    Thread Starter
    Addicted Member jalexander's Avatar
    Join Date
    Jan 2011
    Location
    Memphis, TN
    Posts
    160

    Re: okie..i logged in! (webreq) yeehaw! now how do I nav to other neato ish?

    Quote Originally Posted by dunfiddlin View Post
    No. It tickles a website's tummy and asks nicely for whatever it's willing to give. In most cases where a specific response protocol isn't in place that's the source HTML so you could just carry on making web requests to the relevant pages to navigate around. If you want to actually see the page or manipulate it using VB's HTML commands you would write the source HTML to a browser document.
    Ok awhile back Jdeezy on here was helping me out/tutoring me....he told me that there was a method....where as.....you could download a webpage using kinda like webrequest...& it would download the data + render it (virtually) without having to be shown in a WebBrowser control. Now are you saying there is a difference between a webbrowser 'document' & a webbrowser 'control' ? Because if it has anything to do with the built-in IE6 WebBrowser control I definitely do not want to use it!

    Like is there a difference between the MSHTML method & the WebBrowser1.document Control? I think that's what I'm asking to be explained. It's mad confusing!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width