Label from text on the internet?

Discussion in 'Programming & Scripting' started by lazyazzz12, Jun 24, 2009 with 18 replies and 432 views.

  1. lazyazzz12

    lazyazzz12 Enthusiast

    Messages:
    152
    Ratings:
    11
    Say if i had a blank label and i wanted it to become the text that say I've been offline for 10 min. on xbox.com how would i do that:?

     
  2. Ibdc

    Ibdc Retired Retired

    Messages:
    5,100
    Ratings:
    2,072
    Code:
    Dim wb As New WebBrowser
    Dim gamertag As String = TextBox1.Text.Replace(" ", "+")
    wb.Navigate("http://live.xbox.com/en-US/profile/profile.aspx?pp=0&GamerTag=http://live.xbox.com/en-US/profile/profile.aspx?pp=0&GamerTag=" & gamertag)
    While wb.ReadyState <> WebBrowserReadyState.Complete
    Application.DoEvents()
    End While
    Label1.Text = wb.Document.GetElementById("ctl00_MainContent_myXboxAvatarCard_presenceDisplay_presence").InnerText
     
    • Like Like x 1
  3. OP
    lazyazzz12

    lazyazzz12 Enthusiast

    Messages:
    152
    Ratings:
    11
    Well I tried it on the button and the label and it didn't work.
    Here is the program I was trying to make sorry I don't have a photobucket account so I just posted it as an attachment. I want one label to say they are offline and another one that says how long they have been offline or what game they are playing
    [​IMG]
     
  4. Ibdc

    Ibdc Retired Retired

    Messages:
    5,100
    Ratings:
    2,072
    Well I fixed the problem with the code, but it's still not going to work because you need to log in to be able to see people's profiles, and since the application does that locally (on the person's computer who run's the application), having it log in from your gamertag to check their profile wouldn't really be secure, and you'd probably end up getting hacked. On the other hand if you were to have them log in, no one would use your program because they'd think you'd be trying to steal their account.
     
    • Like Like x 1
  5. OP
    lazyazzz12

    lazyazzz12 Enthusiast

    Messages:
    152
    Ratings:
    11
    well all of the other pictures show up and how would you make it so it logs into a dummy account secretly so they couldn't view it
     
  6. Ibdc

    Ibdc Retired Retired

    Messages:
    5,100
    Ratings:
    2,072
    With just a little bit of effort someone will figure out the dummy account's password, and then they'll change it, and the program won't work anymore. I'm not saying it's not possible, I'm just saying it's not worth it.
     
    • Like Like x 1
  7. Luxurious Meat

    Luxurious Meat Enthusiast

    Messages:
    615
    Ratings:
    120
    Sure, someone could do that, but would anybody really take the time to do something that pointless?
     
  8. ShadowZ

    ShadowZ Enthusiast

    Messages:
    1,364
    Ratings:
    198
    ... Have you seen the internet? There is a lot of people who do pointless stuff like that...
     
  9. Luxurious Meat

    Luxurious Meat Enthusiast

    Messages:
    615
    Ratings:
    120
    True, but literally no good would come from that... Ecept if someone hate him and wanted his app to not work anymore... Or he could jsut make it so it grabs the login details dynamically so he can change it if someone were to change the pass.
     
  10. OP
    lazyazzz12

    lazyazzz12 Enthusiast

    Messages:
    152
    Ratings:
    11
    well could someone tell me how to do it anyway cause i still want to do it ill just update it to another account so that it would work again so how could you make it work?
     
  11. Ibdc

    Ibdc Retired Retired

    Messages:
    5,100
    Ratings:
    2,072
    somewhere under Dim wb as new webbrowser put this
    Code:
    Try
    wb.Navigate("http://login.live.com/login.srf?wa=wsignin1.0&rpsnv=10&ct=1246044679&rver=5.5.4177.0&wp=MBI&wreply=https:%2F%2Flive.xbox.com%2Fxweb%2Flive%2Fpassport%2FsetCookies.ashx%3Frru%3DhttpZ3AZ2FZ2FwwwZ2ExboxZ2EcomZ2FenZ2DUSZ2FdefaultZ2Ehtm&lc=1033&cb=B001033httpZ3AZ2FZ2FwwwZ2ExboxZ2EcomZ2FenZ2DUSZ2FdefaultZ2Ehtm&id=66262")
    While wb.ReadyState <> WebBrowserReadyState.Complete
    Application.DoEvents()
    End While
    wb.Document.GetElementById("i0116").InnerText = "E-Mail Address"
    wb.Document.GetElementById("i0118").InnerText = "Password"
    wb.Document.GetElementById("i0138").SetAttribute("checked", "checked")
    wb.Document.GetElementById("i0011").InvokeMember("click")
    Catch ex As Exception
    End Try
    
     
    • Like Like x 2
  12. OP
    lazyazzz12

    lazyazzz12 Enthusiast

    Messages:
    152
    Ratings:
    11
    i got it to log into a webrowser now how do i get the labels to say if the person is offline or not
     
  13. Ibdc

    Ibdc Retired Retired

    Messages:
    5,100
    Ratings:
    2,072
    I already told you that. Scroll up.
     
    • Like Like x 1
  14. James Iz A Pro

    James Iz A Pro Enthusiast

    Messages:
    62
    Ratings:
    2
    Quick Question Not Relating To This But

    How Did You Make Your Application Look Like That??

    Like The Different Theme Thing
     
  15. OP
    lazyazzz12

    lazyazzz12 Enthusiast

    Messages:
    152
    Ratings:
    11
    Dotnetbar

    Alright this is the code I put for the button all of the pictures load up but the label will not load up to the GamerTag in the textbox even though there are no errors in the code and yes i did put my actual email and password for when i tried it.

    Code:
        Private Sub ButtonX2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX2.Click
    PictureBox2.ImageLocation = ("http://avatar.xboxlive.com/avatar/" & TextBoxX1.Text & "/avatar-body.png")
    PictureBox1.ImageLocation = ("http://card.mygamercard.net/" & TextBoxX1.Text & ".png")
    PictureBox3.ImageLocation = ("http://halocharts.com/sigs/" & TextBoxX1.Text & "_01.jpg?cb=7634")
    PictureBox4.ImageLocation = ("http://avatar.xboxlive.com/avatar/" & TextBoxX1.Text & "/avatarpic-l.png")
    Dim wb As New WebBrowser
    Try
    wb.Navigate("http://login.live.com/login.srf?wa=wsignin1.0&rpsnv=10&ct=1246044679&rver=5.5.4177.0&wp=MBI&wreply=https:%2F%2Flive.xbox.com%2Fxweb%2Flive%2Fpassport%2FsetCookies.ashx%3Frru%3DhttpZ3AZ2FZ2FwwwZ2ExboxZ2EcomZ2FenZ2DUSZ2FdefaultZ2Ehtm&lc=1033&cb=B001033httpZ3AZ2FZ2FwwwZ2ExboxZ2EcomZ2FenZ2DUSZ2FdefaultZ2Ehtm&id=66262")
    While wb.ReadyState <> WebBrowserReadyState.Complete
    Application.DoEvents()
    End While
    wb.Document.GetElementById("i0116").InnerText = "EMAIL"
    wb.Document.GetElementById("i0118").InnerText = "PASSWORD"
    wb.Document.GetElementById("i0138").SetAttribute("checked", "checked")
    wb.Document.GetElementById("i0011").InvokeMember("click")
    Dim gamertag As String = TextBoxX1.Text.Replace(" ", "+")
    [COLOR=Red]   [B]wb.Navigate("http://live.xbox.com/en-US/profile/profile.aspx?pp=0&GamerTag=http://live.xbox.com/en-US/profile/profile.aspx?pp=0&GamerTag=" & TextBoxX1.Text)[/B][/COLOR]
    While wb.ReadyState <> WebBrowserReadyState.Complete
    Application.DoEvents()
    End While
    LabelX1.Text = wb.Document.GetElementById("ctl00_MainContent_myXboxAvatarCard_presenceDisplay_presence").InnerText
    Catch ex As Exception
    End Try
    End Sub
     
  16. James Iz A Pro

    James Iz A Pro Enthusiast

    Messages:
    62
    Ratings:
    2
    Can You Give Me A Download To The Cracked Version Or Sumthin?
     
  17. OP
    lazyazzz12

    lazyazzz12 Enthusiast

    Messages:
    152
    Ratings:
    11
    im just using the trial version at the moment and when it runs out ill google the crack version not that hard
     
  18. Ibdc

    Ibdc Retired Retired

    Messages:
    5,100
    Ratings:
    2,072
    I edited your post, and made the line that's wrong red. There's two things wrong with it. You pasted the link twice, and for whatever reason even after making a string out of their gamertag with spaces replaced with plus signs, you still put & TextboxX1.Text instead of & gamertag
     
    • Like Like x 1
  19. OP
    lazyazzz12

    lazyazzz12 Enthusiast

    Messages:
    152
    Ratings:
    11
    I changed it but the label will not change could you just fix it I'm confused on why it does not work with this code
    Code:
        Private Sub ButtonX2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX2.Click
    PictureBox2.ImageLocation = ("http://avatar.xboxlive.com/avatar/" & TextBoxX1.Text & "/avatar-body.png")
    PictureBox1.ImageLocation = ("http://card.mygamercard.net/" & TextBoxX1.Text & ".png")
    PictureBox3.ImageLocation = ("http://halocharts.com/sigs/" & TextBoxX1.Text & "_01.jpg?cb=7634")
    PictureBox4.ImageLocation = ("http://avatar.xboxlive.com/avatar/" & TextBoxX1.Text & "/avatarpic-l.png")
    Dim wb As New WebBrowser
    Try
    wb.Navigate("http://login.live.com/login.srf?wa=wsignin1.0&rpsnv=10&ct=1246044679&rver=5.5.4177.0&wp=MBI&wreply=https:%2F%2Flive.xbox.com%2Fxweb%2Flive%2Fpassport%2FsetCookies.ashx%3Frru%3DhttpZ3AZ2FZ2FwwwZ2ExboxZ2EcomZ2FenZ2DUSZ2FdefaultZ2Ehtm&lc=1033&cb=B001033httpZ3AZ2FZ2FwwwZ2ExboxZ2EcomZ2FenZ2DUSZ2FdefaultZ2Ehtm&id=66262")
    While wb.ReadyState <> WebBrowserReadyState.Complete
    Application.DoEvents()
    End While
    wb.Document.GetElementById("i0116").InnerText = "EMAIL"
    wb.Document.GetElementById("i0118").InnerText = "PASSWORD"
    wb.Document.GetElementById("i0138").SetAttribute("checked", "checked")
    wb.Document.GetElementById("i0011").InvokeMember("click")
    Dim gamertag As String = TextBoxX1.Text.Replace(" ", "+")
    wb.Navigate("http://live.xbox.com/en-US/profile/profile.aspx?pp=0&GamerTag=" & gamertag)
    While wb.ReadyState <> WebBrowserReadyState.Complete
    Application.DoEvents()
    End While
    LabelX1.Text = wb.Document.GetElementById("ctl00_MainContent_myXboxAvatarCard_presenceDisplay_presence").InnerText
    Catch ex As Exception
    End Try
    End Sub
     

Share This Page