如题,谢谢各位作答
解决方案 »
- OnInitDialog()进不去,从EVC移植到vs2005出现的错误
- 两个窗体相互切换问题!!在线等!!
- 升星星,散分分。。。[1]
- 在CHtmlView上,用荧光笔画图的问题?
- 关于文件的操作
- 请问如何让自己的服务可以早点启动(普通服务,不是驱动服务)?
- 一个难度高的算法问题,是数据结构上的题目,高手帮忙!!
- 请问如何截获在IE浏览器中点击某个连接后的动作(如网络蚂蚁的点击下载)
- 100分,使用ado,如何删除foxpro数据库中日期符合一定条件的记录,也就是说如何写比较时间的sql语句,时间如何处理?
- 关于消息映射和DECLARE_DYNAMIC IMPLEMENT_DYNAMIC的问题
- 如何让CXIMAGE配合上换肤软件对程序进行PNG换肤?
- CMFCButton怎么不能EnableWindowsTheming()
CInternetSession CIS;
CHttpConnection *http = NULL;
CHttpFile *file = NULL;
http = CIS.GetHttpConnection("bt1.54new.com",INTERNET_FLAG_EXISTING_CONNECT,8080);
file = http->OpenRequest(1,"/announce?info_hash=184894216CF1F674310BEDB6A4BD5AFEC7E391D1&peer_id=0000000000000000000000001B65A5CE893ADDBC&port=5000&uploaded=0&download=0&left=107207984");
但貌似没用哦,这样可以吗?还是参数有误?
GET /announce?info_hash=1%11%3F%CC%D9%E0%C7%91%D2%B2e%19d%9B%08%2Ba%3F%E6%E2&peer_id=%2DBC0062%2D%16%18%83%7F%CC%DF%C3%DC%A453%C3&port=13506&uploaded=0&downloaded=0&left=0&compact=1&event=started&numwant=50 HTTP/1.1
Host:222.208.183.16
User-Agent: BitTorrent/3.4.2
Accept:*/*
Connection:close这在程序里怎么写?谢谢!
HTTP_VERB_POST 0
HTTP_VERB_GET 1
HTTP_VERB_HEAD 2
HTTP_VERB_PUT 3
HTTP_VERB_LINK 4
HTTP_VERB_DELETE 5
HTTP_VERB_UNLINK 6
ResCall this member function to open an HTTP connection.dwFlags can be one of the following:Internet flag Description
INTERNET_FLAG_RELOAD Forces a download of the requested file, object, or directory listing from the origin server, not from the cache.
INTERNET_FLAG_DONT_CACHE Does not add the returned entity to the cache.
INTERNET_FLAG_MAKE_PERSISTENT Adds the returned entity to the cache as a persistent entity. This means that standard cache cleanup, consistency checking, or garbage collection cannot remove this item from the cache.
INTERNET_FLAG_SECURE Uses secure transaction semantics. This translates to using SSL/PCT and is only meaningful in HTTP requests
INTERNET_FLAG_NO_AUTO_REDIRECT Used only with HTTP, specifies that redirections should not be automatically handled in CHttpFile::SendRequest.
Override the dwContext default to set the context identifier to a value of your choosing. The context identifier is associated with this specific operation of the CHttpConnection object created by its CInternetSession object. The value is returned to CInternetSession::OnStatusCallback to provide status on the operation with which it is identified. See the articleInternet First Steps: WinInet for more information about the context identifier.
这有一个 你看看对你有没有帮助
sprintf(sendStr, "GET http://%s:%d/CameraID=%d&Type=zyh264 HTTP/1.1\r\n\r\n", m_szIP, m_iPort, m_iCameraID);
send(sock, sendStr);
HTTP就是基于TCP协议的
是一个超文本传输的应用层协议
下面是请求某个文件的一部分数据的HTTP GET请求例子 // 构造请求头
CStringA strReqest;
CStringA strRange;
strRange.Format("%d-%d",task.nFrom,task.nTo);
strReqest.Append("GET ");
strReqest.Append("http://");
strReqest.Append(m_stHost);
strReqest.Append(task.strFileURL);
strReqest.Append(" HTTP/1.1\r\n");
strReqest.Append("Accept: */*\r\n");
strReqest.Append("Accept-Language: zh-cn\r\n");
strReqest.Append("Accept-Encoding: gzip, deflate\r\n");
strReqest.Append("User-Agent:iSpeeded 1.0.0.1 (Windows)\r\n");
strReqest.Append("Host: ");
strReqest.Append(m_stHost);
strReqest.Append("\r\n");
strReqest.Append("Range:bytes=");
strReqest.Append(strRange);
strReqest.Append("\r\n");
strReqest.Append("Connection: Keep-Alive\r\n");
strReqest.Append("Pragma: no-cache\r\n");
strReqest.Append("Cache-Control: no-cache\r\n\r\n");
nRet = send(hsocket,strReqest,strReqest.GetLength(),0);