none
how to logout from facebook account ? RRS feed

  • Question

  • hi to guys

    i use webbrowser component in my project and want logout account in facebook and login with another accounts

    i test with clear cookies,work fine but need to restart Program and this not good idea

    facebook for logout make key like this > www.facebook.com/index.php?lh=8b21a93ec86149afdf45a314877c1985

    and i can't access this key from webbrowser.this is html tag from this key

    <input type="hidden" autocomplete="off" name="h" value="8b21a93ec86149afdf45a314877c1985" /><label class="uiLinkButton logoutButton navSubmenu"><input type="submit" value="Log Out" />

    now how can access to key with grab key from html tag ?

    any idea and solutions ?

     

    thanks for your replys

    Regards

    Amir Amini

     

     

    Sunday, November 13, 2011 7:21 AM

Answers

  • do you can give me sample code ?

    Thanks mate

    Code sample

            Dim inputTagCollection = WebBrowser1.Document.GetElementsByTagName("input")
            For Each inputTag As HtmlElement In inputTagCollection
                'inputTag.OuterHtml will give you the actual html element as string
                'you can parse that string to extract the value
            Next
    
    



    Thanks,
    A.m.a.L Hashim
    Microsoft Most Valuable Professional
    Dot Net Goodies
    • Marked as answer by Amir Amini Sunday, November 13, 2011 6:53 PM
    Sunday, November 13, 2011 3:36 PM

All replies

  • Try using the method GetElementsByTagName and iterate through the returned collection to grab the value field.
    Thanks,
    A.m.a.L Hashim
    Microsoft Most Valuable Professional
    Dot Net Goodies
    Sunday, November 13, 2011 7:39 AM
  • do you can give me sample code ?

    Thanks mate

    Sunday, November 13, 2011 10:29 AM
  • do you can give me sample code ?

    Thanks mate

    Code sample

            Dim inputTagCollection = WebBrowser1.Document.GetElementsByTagName("input")
            For Each inputTag As HtmlElement In inputTagCollection
                'inputTag.OuterHtml will give you the actual html element as string
                'you can parse that string to extract the value
            Next
    
    



    Thanks,
    A.m.a.L Hashim
    Microsoft Most Valuable Professional
    Dot Net Goodies
    • Marked as answer by Amir Amini Sunday, November 13, 2011 6:53 PM
    Sunday, November 13, 2011 3:36 PM
  • Thank You very Much Bro
    Sunday, November 13, 2011 6:53 PM