MCPcopy Create free account
hub / github.com/acl-dev/acl / OnBnClickedDownload

Method OnBnClickedDownload

lib_acl_cpp/samples/HttpClient/HttpClientDlg.cpp:186–223  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

184}
185
186void CHttpClientDlg::OnBnClickedDownload()
187{
188 // TODO: �ڴ����ӿؼ�֪ͨ�����������
189
190 if (service_ == NULL)
191 {
192 printf("service_ null\r\n");
193 return;
194 }
195
196 // ���� HTTP �������
197 acl::string domain;
198 domain = "www.banmau.com";
199 //domain = "192.168.1.229";
200 //domain = "www.renwou.net";
201 CHttpDownload* req = NEW CHttpDownload(domain.c_str(), 80, &handle_);
202 req->SetHWnd(this->GetSafeHwnd());
203 //req->set_url("/index.html");
204 req->set_url("/download/banma_install.exe");
205 req->set_host(domain);
206 req->set_keep_alive(false);
207 req->set_method(acl::HTTP_METHOD_GET);
208 req->add_cookie("x-cookie-name", "cookie-value");
209 //req->set_redirect(1); // �����Զ��ض���Ĵ�������
210
211 // ֪ͨ�첽��Ϣ������������ HTTP �������
212
213 //////////////////////////////////////////////////////////////////////////
214 //acl::string buf;
215 //req->build_request(buf);
216 //printf("-----------------------------------------------\n");
217 //printf("%s", buf.c_str());
218 //printf("-----------------------------------------------\n");
219 //////////////////////////////////////////////////////////////////////////
220
221 GetDlgItem(IDC_DOWNLOAD)->EnableWindow(FALSE);
222 service_->do_request(req);
223}
224
225LRESULT CHttpClientDlg::OnDownloadOk(WPARAM wParam, LPARAM lParam)
226{

Callers

nothing calls this directly

Calls 6

CHttpDownloadClass · 0.85
SetHWndMethod · 0.80
set_keep_aliveMethod · 0.80
add_cookieMethod · 0.80
do_requestMethod · 0.80
c_strMethod · 0.45

Tested by

no test coverage detected