wm 手机发送彩信问题,高分求教高手
HINTERNET hSession=InternetOpen(L"InternetAccess",INTERNET_OPEN_TYPE_PROXY, L"10.0.0.172:80",NULL,0);
//HINTERNET hSession=InternetOpen(L"InternetAccess",INTERNET_OPEN_TYPE_DIRECT, NULL,NULL,0);
//if(!hSession)
//goto error;
HINTERNET hConnect = InternetConnect(hSession, L"10.0.0.172", 80, L"HTTP/1.1", NULL, INTERNET_SERVICE_HTTP, NULL, 0);
//if(!hConnect)
//goto error;
LPCTSTR szAcceptType[2] =
{
_T("application/vnd.wap.mms-message,text/plain,*/*"), NULL,
};
long dataLen=Len;
//"http://mmsc.myuni.com.cn/"http://mmsc.monternet.com/
HINTERNET hRequest = HttpOpenRequest(hConnect, L"POST", L"http://mmsc.monternet.com/",HTTP_VERSION, NULL, szAcceptType, 0, 0);
HttpAddRequestHeaders(hRequest,_T("Content-Type:application/vnd.wap.mms-message"),- 1,HTTP_ADDREQ_FLAG_ADD|HTTP_ADDREQ_FLAG_REPLACE);
HttpAddRequestHeaders(hRequest,_T("Host:10.0.0.172:80"),- 1,HTTP_ADDREQ_FLAG_ADD|HTTP_ADDREQ_FLAG_REPLACE);
HttpAddRequestHeaders(hRequest,_T("Accept-Charset:utf-8"),- 1,HTTP_ADDREQ_FLAG_ADD|HTTP_ADDREQ_FLAG_REPLACE);
HttpAddRequestHeaders(hRequest,_T("Accept-Language:en"),- 1,HTTP_ADDREQ_FLAG_ADD|HTTP_ADDREQ_FLAG_REPLACE);
wchar_t contentLength[32]={0};
wsprintf(contentLength,L"Content-Length:%ld",dataLen);
HttpAddRequestHeaders(hRequest,contentLength,-1,HTTP_ADDREQ_FLAG_ADD|HTTP_ADDREQ_FLAG_REPLACE);
HttpAddRequestHeaders(hRequest,_T("User-Agent:AmoiE860/6.1.08/WAP2.0 Profile/MIDP2.0 Configuration/CLDC1.1 Mozilla/4.0"),-1,HTTP_ADDREQ_FLAG_ADD|HTTP_ADDREQ_FLAG_REPLACE);
HttpAddRequestHeaders(hRequest,_T("x-wap-profile:http://www.arcsoft.com.cn/uaprof/ArcSoft-PPC-MMSUA30.xml"),-1,HTTP_ADDREQ_FLAG_ADD|HTTP_ADDREQ_FLAG_REPLACE);
HttpAddRequestHeaders(hRequest,_T("Connection:Keep-Alive"),-1,HTTP_ADDREQ_FLAG_ADD|HTTP_ADDREQ_FLAG_REPLACE);
//if(!hRequest)
//goto error;
BOOL bhr= HttpSendRequest(hRequest, NULL, -1, PostData, dataLen);
GPRS已经连接上了,通过上面这段代码发送彩信,但是发送不出去,希望大家给解决。