pHttpConnect=session - & gt; 202.193.80.58 GetHttpConnection (_T (" "), nPort);
//post method to submit the login data
PFile=pHttpConnect - & gt; OpenRequest (CHttpConnection: : HTTP_VERB_POST, _T ("/academic/j_acegi_security_check "));
//here is a post request header data obtained from firefox caught
Cstrings head;
PFile - & gt; AddRequestHeaders (_T (Host: 202.193.80.58: "81"));
PFile - & gt; AddRequestHeaders (_T (" the user-agent: Mozilla/5.0 (Windows NT 10.0; WOW64. The rv: 49.0) Gecko/20100101 Firefox/49.0 "));
PFile - & gt; AddRequestHeaders (_T (" Accept: text/HTML and application/XHTML + XML, application/XML. Q=0.9 */*; Q=0.8 "));
PFile - & gt; AddRequestHeaders (_T (" Accept - Language: useful - CN, useful; Q=0.8, en - US; Q=0.5, en. Q=0.3 "));
PFile - & gt; AddRequestHeaders (_T (" Accept - Encoding: gzip, deflate "));
PFile - & gt; AddRequestHeaders (_T (Referer: "http://202.193.80.58:81/academic/index.jsp"));
PFile - & gt; AddRequestHeaders (_T (" cookies: ") + cookies. Left (47));
PFile - & gt; AddRequestHeaders (_T (" Connection: keep - the alive "));
PFile - & gt; AddRequestHeaders (_T (" Upgrade - Insecure - Requests: 1 "));
PFile - & gt; AddRequestHeaders (_T (" "));
Cstrings pw.
//to submit data
Pw=_T (" j_username="+ name + _T (" & amp; J_password=") + password + _T (" & amp; J_captcha=") + m_yzm + _T (" & amp; For the=C2 B5 C7 + % % % % BC ");
//char * request=pw. GetBuffer ();//cstrings into a char array pointer
MessageBox (pw) GetBuffer ());//message box return the check to submit data
USES_CONVERSION;
//submit data
PFile - & gt; The SendRequest (NULL, 0, W2A (pw) GetBuffer ()), pw, GetLength ());
CodePudding user response:
Always returns please enter the verification code messageCodePudding user response:
That's because the submitted data is considered by the server didn't log in, or think you are procedures, need analysis is how to identify your server firstCodePudding user response: