使用C++程序获取新浪行情数据的方法

2020-01-06 13:27:12王振洲
  • printf("%sn", Temp);   
  • for(int i=0; i  { 
  • printf("%sn", vec[i]);  } 
  • }   
  • InternetCloseHandle(hHttp);  hHttp = NULL; 
  •   } 
  • InternetCloseHandle(hSession);  hSession = NULL; 
  •   } 
  •   } 
  •   std::string GetSubBtFind(char* lpsz) 
  • {  std::string scrStr=lpsz; 
  • std::string str_temp="";  int len=strlen(lpsz); 
  • int beginPos=scrStr.find(""");  scrStr=scrStr.substr(beginPos+1,len); 
  • int endPos=scrStr.find(""");   
  • str_temp=scrStr.substr(0,endPos);   
  • return str_temp;   
  • }   
  • int Token(const char* pSep, char* pStr, std::vector& refvec)  { 
  • for(char* outer = strtok(pStr, pSep) ; NULL != outer; outer = strtok(NULL, pSep))  { 
  • refvec.push_back(outer);  } 
  •   return 0; 
  • 上述代码在vs2008下运行结果如下:

    使用C++程序获取新浪行情数据的方法

    以上就是本文的全部内容,希望对大家熟练应用C++程序抓取数据有所帮助