Use Wininet according to RFC1867 Submit form

zhaozj2021-02-16  69

CInternetSession m_Session ( "DigitalTitan"); CHttpConnection * pServer = NULL; CHttpFile * pFile = NULL; CString strServerName = m_ServerName; INTERNET_PORT nPort = (INTERNET_PORT) atoi (m_ServerPort); CString strURL = m_DesignFile; try {pServer = m_Session.GetHttpConnection (strServerName , nPort); // AfxMessageBox (strServerName, MB_ICONINFORMATION); pFile = pServer-> OpenRequest (CHttpConnection :: HTTP_VERB_POST, strURL, NULL, 1, NULL, NULL, INTERNET_FLAG_EXISTING_CONNECT); // AfxMessageBox (strURL, MB_ICONINFORMATION); CString strBoundary = "-------------------------- 7D33A816D302B6"; // Difference line CGI program responds change. Pfile-> addRequestHeaders (" Content-type: multipart / form-data, bside = " strboundary; pfile-> addRequestHeaders; char * pbuf = new char [1024 * 10000]; // Construction form start FieldStruct * PfieldStruct = new fieldStruct; position currentPosition; for (int IINDEX = 0; IIndex

STRCAT (PBUF, (LPTSTSTSTSTSTS strboundary);

转载请注明原文地址:https://www.9cbs.com/read-17557.html

New Post(0)