`
mylove2060
  • 浏览: 331407 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论
文章列表
#include "stdafx.h" #include <Winsock2.h> #include <iostream> int _tmain(int argc, _TCHAR* argv[]) { for(int i = 0;i<5;i++) { AllocConsole(); // Create a new console window std::cout<<i<<std::endl; Sleep(1000); // Sleep for 1000 ms=1 s F ...
#include "stdafx.h" #include <string> #include <cstring> int _tmain(int argc, _TCHAR* argv[]) { std::string numstr = "23423"; //first convertion const char *chars1 = numstr.c_str(); //const char * //second convertion char *chars2 =0 ; chars2 = ne ...
Author:QQ174554431 #include <boost/algorithm/string.hpp> string in_path = "test1,test2,test3,test4,test5"; std::vector<std::string> m_currentPath; boost::algorithm::split(m_currentPath, in_path, boost::algorithm::is_any_of(",")); for(size_t i = 0;i<m_c ...
#include "windows.h" #include <string> #include "tlhelp32.h" #include <iostream> #include <stdio.h> #include <tchar.h> #include <vector> void FindAllProcessIdsByName(std::vector<DWORD>& outProcessIDsContainer,const std::string& ...
#include "windows.h" #include <string> #include "tlhelp32.h" #include <iostream> #include <stdio.h> #include <tchar.h> #include <vector> void FindAllProcessIdsByName(std::vector<DWORD>& outProcessIDsContainer,const std::string& ...
工程编译输出文件为Test.exe #include "windows.h" #include <string> #include "tlhelp32.h" #include <iostream> #include <stdio.h> #include <tchar.h> #include <vector> DWORD FindProcessIdByName(const std::string& in_processName) { PROCE ...
void FindAllProcessNames(vector<string>& outProcessesContainer ) { PROCESSENTRY32 processInfo; processInfo.dwSize = sizeof(processInfo); HANDLE processesSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, NULL); if (processesSnapshot == INVALID_HANDLE_VALUE ...
DWORD FindProcessIdByName(const std::string& in_processName) { PROCESSENTRY32 processInfo; processInfo.dwSize = sizeof(processInfo); HANDLE processesSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, NULL); if (processesSnapshot == INVALID_HANDLE_VALUE) { return ...
头文件#include <windows.h>  char moduleFileName[MAX_PATH]; GetModuleFileNameA(0, moduleFileName, MAX_PATH); 取得的路径为:c:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\Projects \Test\debug\Test.exe char moduleFileName[MAX_PATH]; GetModuleFileNameA(NULL, m ...
Author:QQ174554431 #include "stdafx.h" #include <boost/bind.hpp> #include <boost/thread/thread.hpp> #include <iostream> void Thread1() { int num = 0; bool flag = true; while(flag) { std::cout << "----Thread1----" <<std::end ...
client side: #include "stdafx.h" #include <iostream> #include <boost/asio.hpp> int main(int argc, char* argv[]) { // 所有asio类都需要io_service对象 boost::asio::io_service iosev; // socket对象 boost::asio::ip::tcp::socket socket(iosev); // 连接服务器 boost::s ...
function isAmount( s){ var rx1= new RegExp("^[-]{0,1}[1-9][0-9]*(.[0-9]{1,6}){0,1}$"); var rx2 = new RegExp("^[0]{0,1}$"); var rx3 = new RegExp("^[-]{0,1}[0].[0-9]{1,6}$"); retval1 = rx1.test(s)?true:false; retval2 = rx2.test(s)?true:false; retval ...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <title>K2046.TableSorter</title> <style type="text/cs ...
主要应用头文件 #include <boost/cstdint.hpp> #include <sstream> 方法1 boost::uint16_t number = 255; std::stringstream convertor; convertor.setf(std::ios::hex,std::ios::basefield); convertor<<static_cast<int>(number); string str = convertor.str(); cout<<str<<end ...
TiXmlElement *in_elem = new TiXmlElement("tagname"); TiXmlText *text = new TiXmlText( "Hello World" ); in_elem->LinkEndChild(text); TiXmlPrinter printer; in_elem->Accept( &printer ); std::string stringBuffer = printer.CStr(); cout<<stringBuffer; ...
Global site tag (gtag.js) - Google Analytics