scbc.tools.cpp 836 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // scbc.tools.cpp : 定义 DLL 应用程序的导出函数。
  2. //
  3. #include "stdafx.h"
  4. #include "scbc.tools.h"
  5. #include "CurlClient.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #endif
  9. // 唯一的应用程序对象
  10. CWinApp theApp;
  11. using namespace std;
  12. int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
  13. {
  14. int nRetCode = 0;
  15. // 初始化 MFC 并在失败时显示错误
  16. if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
  17. {
  18. // TODO: 更改错误代码以符合您的需要
  19. _tprintf(_T("错误: MFC 初始化失败\n"));
  20. nRetCode = 1;
  21. }
  22. else
  23. {
  24. // TODO: 在此处为应用程序的行为编写代码。
  25. std::string data;
  26. CCurlClient curl;
  27. curl.Initialize();
  28. if ( curl.DownloadEx("https://dldir1.qq.com/weixin/Windows/WeChatSetup.exe", "D:\\WeChatSetup.exe", 5000) )
  29. printf("下载成功\n");
  30. else
  31. printf("下载失败\n");
  32. system("pause");
  33. }
  34. return nRetCode;
  35. }