Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Log in to website

Log in to website

Scheduled Pinned Locked Moved C / C++ / MFC
c++htmlcomhelp
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    baloneyman
    wrote on last edited by
    #1

    I have this VBA code: (uses MS HTML library MSHTML.tlb) Public ie As InternetExplorer Sub RacingPost_Login() Set ie = CreateObject("InternetExplorer.Application") ie.Visible = True 'Go to this Web Page! ie.navigate "https://reg.racingpost.co.uk/cde/login\_iframe.sd" ' (waits here for good connection) With ie.document.forms(0) .in_un.Value = "USERNAME" .in_pw.Value = "PASSWORD" .submit End With I would like to do this in C++. I've tried for 4+ days. Any help is greatly appreciated. Thanks, Roy

    R 1 Reply Last reply
    0
    • B baloneyman

      I have this VBA code: (uses MS HTML library MSHTML.tlb) Public ie As InternetExplorer Sub RacingPost_Login() Set ie = CreateObject("InternetExplorer.Application") ie.Visible = True 'Go to this Web Page! ie.navigate "https://reg.racingpost.co.uk/cde/login\_iframe.sd" ' (waits here for good connection) With ie.document.forms(0) .in_un.Value = "USERNAME" .in_pw.Value = "PASSWORD" .submit End With I would like to do this in C++. I've tried for 4+ days. Any help is greatly appreciated. Thanks, Roy

      R Offline
      R Offline
      Rajesh R Subramanian
      wrote on last edited by
      #2

      baloneyman wrote:

      I would like to do this in C++. I've tried for 4+ days.

      May I see what you've done in 4+ days?

      B 1 Reply Last reply
      0
      • R Rajesh R Subramanian

        baloneyman wrote:

        I would like to do this in C++. I've tried for 4+ days.

        May I see what you've done in 4+ days?

        B Offline
        B Offline
        baloneyman
        wrote on last edited by
        #3

        Hi, Most of the attempts were erased. I was just using this stub to plug things in. I can get logged just by tagging the parameters to the url and doing a navigate. But that way ends up at a splash screen which the VBA code bypasses. This one I think was from MSDN:

        CString strHeaders =
        _T("Content-Type: application/x-www-form-urlencoded");

        CString strFormData = _T("in_un=xxx&in_pw=xxx&process=IN&PARGS=http%253A%252F%252Fwww.racingpost.co.uk%252Fnews%252Fhome.sd");

        CInternetSession session;
        CHttpConnection* pConnection =
        session.GetHttpConnection(_T("https://reg.racingpost.co.uk/cde/login\_iframe\_rp.sd"));

        CHttpFile* pFile =
        pConnection->OpenRequest(CHttpConnection::HTTP_VERB_POST, _T("rp_sign"));

        BOOL result = pFile->SendRequest(strHeaders,
        (LPVOID)(LPCTSTR)strFormData, strFormData.GetLength());

        The form is:

        I am not too much when it comes to HTTP Thanks, Roy

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups