How can i ping remote computer on my Windows computer with c++?
问题 I used below code. It works, but in debug mode in Visual Studio if you stop the debug the computer gave blue screen so it is not useful. I did some research and i found this is a common bug for icmpapi. Is there a any way to ping computer c++? #include <winsock2.h> #include <iphlpapi.h> #include <icmpapi.h> //Declare and initialize variables HANDLE hIcmpFile; unsigned long ipaddr = INADDR_NONE; DWORD dwRetVal = 0; DWORD dwError = 0; char SendData[] = "Data Buffer"; LPVOID ReplyBuffer = NULL;