Log in to website
-
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
-
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
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?
-
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?
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