随笔分类 - 《Visual C++ 代码片段笔记》
摘要:服务端(server) #include <stdio.h> #include <winsock2.h> #pragma comment(lib,"ws2_32.lib") //把ws2_32.lib加到Link页的连接库 #define PORT 15001 //通信的端口(指服务器端) #def
阅读全文
摘要:实现简单的Socket通信 服务端代码(Server) #include <stdio.h> #include <winsock2.h> #pragma comment(lib,"ws2_32.lib") #define PORT 9999 int main() { WSADATA WSAData;
阅读全文
摘要:#include <windows.h> #include <tlhelp32.h> //进程快照函数头文件 #include <stdio.h> bool getProcess(const char *procressName) //此函数进程名不区分大小写 { char pName[MAX_PA
阅读全文
摘要:遍历进程 #include <windows.h> #include <tlhelp32.h> //进程快照函数头文件 #include <stdio.h> int main() { int countProcess=0; //当前进程数量计数变量 PROCESSENTRY32 currentPro
阅读全文
摘要:#include <string> #include<iostream> #include<windows.h> #include <sstream> using namespace std; string WORDToString(WORD w) { char tmpbuff[16]; sprin
阅读全文
摘要:#include<winsock2.h> #include<iostream> #include<string> using namespace std; #pragma comment(lib, "WS2_32.lib") string getIP() { WSADATA WSAData; cha
阅读全文
摘要:#include<stdio.h> #include<winsock2.h> //该头文件需在windows.h之前 #include<windows.h> #include<string> #include<iostream> #pragma comment(lib,"ws2_32.lib") u
阅读全文
摘要:#include <iostream> #include <stdio.h> extern long FileSizeof(char *); int main() { if(FileSizeof("\\a.exe")==20499) #指定文件大小 { std::cout<<"没有被破解"<<std
阅读全文
摘要:扫描特征码基地址 #include <stdio.h> #include <stdlib.h> #include <windows.h> union Base { DWORD address; BYTE data[4]; }; /***********************************
阅读全文