Jose Velasquez

Generation

generate functionSun, 18 Jun 2023

programa que ejecute un ping y tome deciciones

#include <iostream> #include <windows.h> using namespace std; int main() { char hostName[128]; DWORD ip; cout << "enter host name:"; cin >> hostName; ip = inet_addr(hostName); if (ip == INADDR_NONE) { hostent *pHostEnt = gethostbyname(hostName); if (pHostEnt == NULL) { cout << "failed to resolve host name" << hostName << endl; return -1; } ip = *(u_long *)pHostEnt->h_addr_list[0]; } HANDLE hIcmp = IcmpCreateFile(); if (hIcmp == INVALID_HANDLE_VALUE) { cout << "failed to open ICMP.dll" << endl; return -1; } char sendData[32] = "data buffer

Questions about programming?Chat with your personal AI assistant