随笔分类 -  C/C++

std::string 转uint64方法:
摘要:#include <string>#include <sstream> uint64 stringToUINT64(const std::string s){ std::stringstream a; a << s; UINT64 ret = 0; a >> ret; return ret;} 阅读全文

posted @ 2017-06-06 14:42 阿兴的平凡世界 阅读(6131) 评论(0) 推荐(0)

c++ _popen读取管道内容(输出内容)例子
摘要:FILE * pPipe = _popen(_postExEPath.toStdString().c_str(), "rb");QString strData;if (pPipe){ while (!feof(pPipe)){std::string tempStr(1024, '\0');fgets 阅读全文

posted @ 2017-05-19 15:27 阿兴的平凡世界 阅读(6699) 评论(0) 推荐(0)

c++根据进程名称kill进程(不保险,最好根据进程id)
摘要:BOOL ClientApp::KillProcessByName(const TCHAR *lpszProcessName) { unsigned int pid = -1; BOOL retval = TRUE; if (lpszProcessName == NULL) return -1; D 阅读全文

posted @ 2017-05-04 21:35 阿兴的平凡世界 阅读(2887) 评论(0) 推荐(0)

c++检测本机网络
摘要:bool checkProxyNetwork(){ WSADATA wsaData; if (WSAStartup(MAKEWORD(2, 2), &wsaData) != 0) { qDebug() << "找不到可使用的WinSock dll!" << endl; return false; } 阅读全文

posted @ 2017-05-04 21:34 阿兴的平凡世界 阅读(804) 评论(0) 推荐(0)

ShellExecuteEx 阻塞和异步调用进程的两种方法
摘要:阻塞: SHELLEXECUTEINFO ShExecInfo = { 0 }; ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO); ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS; ShExecInfo.hwnd = N 阅读全文

posted @ 2017-04-20 17:52 阿兴的平凡世界 阅读(1056) 评论(0) 推荐(0)

导航