FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Hacer Ping a un PC, Como ?
Posts: 883
Joined: Tue Oct 11, 2005 11:57 AM
Hacer Ping a un PC, Como ?
Posted: Tue Jan 18, 2011 01:59 PM

Holas a todos.

Eso... Como puedo hacer un ping() a un Pc para saber si esta funcionando.

NEcesito saber si un Pc o Servidor ( del cual conozco su IP ) esta conectado para decidir si conectarme a el o nop.
Encontre una solucion aqui en el foro del a帽o 2008 y usa una clase propia (twebservice) o algo asi. Pero quisiera saber si hay algo mas "nuevito"

La funcion GetHostByAddress() a veces me retorna ""

Saludos
Adolfo

;-) Ji,ji,ji... buena la cosa... "all you need is code"

http://www.xdata.cl - Desarrollo Inteligente
----------
Asus TUF F15, 32GB Ram, 2 * 1 TB NVME M.2, GTX 1650
Posts: 54
Joined: Thu Dec 27, 2007 06:56 PM
Re: Hacer Ping a un PC, Como ?
Posted: Tue Jan 18, 2011 03:28 PM

Hola Adolfo

Y su usas un bat desde el cual realizar el ping, el resultado lo puedes direccionar a un txt y evaluarlo; si en el texto no se presenta la frase "Tiempo de espera agotado para esta solicitud" significa que realizo el ping.
El archivo bat reciviria como parametro la ip a evaluar.

Saludos

Mart铆n

Posts: 883
Joined: Tue Oct 11, 2005 11:57 AM
Re: Hacer Ping a un PC, Como ?
Posted: Tue Jan 18, 2011 04:05 PM

Martin

El problema es la velocidad, ya que debo hacer ping a 3 maquinas, y en algunos pc's la velocidad del ping y sus 4 reintentos es muy alta.
Como se hace al inicio del programa, mas de alguna queja voy a recibir.

Gracias

Adolfo

;-) Ji,ji,ji... buena la cosa... "all you need is code"

http://www.xdata.cl - Desarrollo Inteligente
----------
Asus TUF F15, 32GB Ram, 2 * 1 TB NVME M.2, GTX 1650
Posts: 422
Joined: Mon Aug 17, 2009 12:18 PM
Re: Hacer Ping a un PC, Como ?
Posted: Tue Jan 18, 2011 06:46 PM
Hola Adolfo:

Prueba as铆:

Code (fw): Select all Collapse
#include "FiveLinux.ch"

function Main()

   MsgInfo( Ping( "192.168.0.22" ) )
   
return nil

#pragma BEGINDUMP   

#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <linux/ip.h>
#include <linux/icmp.h>
#include <string.h>
#include <unistd.h>

char dst_addr[20];
char src_addr[20];

static unsigned short in_cksum(unsigned short *, int);
static void parse_argvs(char**, char*, char* );
static void usage();
static char* getip();
static char* toip(char*);

HB_FUNC( PING )
{
   struct iphdr* ip;
   struct iphdr* ip_reply;
   struct icmphdr* icmp;
   struct sockaddr_in connection;
   char* packet;
   char* buffer;
   int sockfd;
   int optval;
   int addrlen;
   int siz;

   /*
   if (getuid() != 0)
   {
       fprintf(stderr, "%s: root privelidges needed\n", *(argv + 0));
       exit(EXIT_FAILURE);
   }
   */

   // parse_argvs(argv, dst_addr, src_addr);
   strncpy( dst_addr, toip( ( char * ) hb_parc( 1 ) ), 20 );
   strncpy( src_addr, toip( getip() ), 20 );
   // printf("Source address: %s\n", src_addr);
   // printf("Destination address: %s\n", dst_addr);

   /*
    * allocate all necessary memory
   */
   packet = malloc(sizeof(struct iphdr) + sizeof(struct icmphdr));
   buffer = malloc(sizeof(struct iphdr) + sizeof(struct icmphdr));
   /****************************************************************/

   ip = (struct iphdr*) packet;
   icmp = (struct icmphdr*) (packet + sizeof(struct iphdr));

   /*
    *  here the ip packet is set up
    */
   ip->ihl                     = 5;
   ip->version                 = 4;
   ip->tos                     = 0;
   ip->tot_len                 = sizeof(struct iphdr) + sizeof(struct icmphdr);
   ip->id                      = htons(0);
   ip->frag_off                = 0;
   ip->ttl                     = 64;
   ip->protocol                = IPPROTO_ICMP;
   ip->saddr                   = inet_addr(src_addr);
   ip->daddr                   = inet_addr(dst_addr);
   ip->check                   = in_cksum((unsigned short *)ip, sizeof(struct iphdr));

   if ((sockfd = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP)) == -1)
   {
       hb_retl( FALSE );
       return;
       // perror("socket");
       // exit(EXIT_FAILURE);
   }

   /*
    *  IP_HDRINCL must be set on the socket so that
    *  the kernel does not attempt to automatically add
    *  a default ip header to the packet
    */

   setsockopt(sockfd, IPPROTO_IP, IP_HDRINCL, &optval, sizeof(int));

   /*
    *  here the icmp packet is created
    *  also the ip checksum is generated
    */
   icmp->type                  = ICMP_ECHO;
   icmp->code                  = 0;
   icmp->un.echo.id            = random();
   icmp->un.echo.sequence      = 0;
   icmp-> checksum             = in_cksum((unsigned short *)icmp, sizeof(struct icmphdr));


   connection.sin_family = AF_INET;
   connection.sin_addr.s_addr = inet_addr(dst_addr);

   /*
    *  now the packet is sent
    */

   sendto(sockfd, packet, ip->tot_len, 0, (struct sockaddr*)&connection, sizeof(struct sockaddr));
   // printf("Sent %d byte packet to %s\n", ip->tot_len, dst_addr);

   /*
    *  now we listen for responses
    */
   addrlen = sizeof(connection);
   if (( siz = recvfrom(sockfd, buffer, sizeof(struct iphdr) + sizeof(struct icmphdr), 0, (struct sockaddr *)&connection, &addrlen)) == -1)
   {
       hb_retl( FALSE );
       // perror("recv");
   }
   else
   {
       hb_retl( TRUE );
       // printf("Received %d byte reply from %s:\n", siz , dst_addr);
       // ip_reply = (struct iphdr*) buffer;
       // printf("ID: %d\n", ntohs(ip_reply->id));
       // printf("TTL: %d\n", ip_reply->ttl);
   }

   free(packet);
   free(buffer);
   close(sockfd);
   // return 0;
}

static void parse_argvs(char** argv, char* dst, char* src)
{
   int i;
   if(!(*(argv + 1)))
   {
       /* there are no options on the command line */
       usage();
       exit(EXIT_FAILURE);
   }
   if (*(argv + 1) && (!(*(argv + 2))))
   {
       /*
        *   only one argument provided
        *   assume it is the destination server
        *   source address is local host
        */
       strncpy(dst, *(argv + 1), 15);
       strncpy(src, getip(), 15);
       return;
   }
   else if ((*(argv + 1) && (*(argv + 2))))
   {
       /*
        *    both the destination and source address are defined
        *    for now only implemented is a source address and
        *    destination address
        */
       strncpy(dst, *(argv + 1), 15);
       i = 2;
       while(*(argv + i + 1))
       {
           if (strncmp(*(argv + i), "-s", 2) == 0)
           {
               strncpy(src, *(argv + i + 1), 15);
               break;
           }
           i++;
       }
   }

}

static void usage()
{
   fprintf(stderr, "\nUsage: pinger [destination] <-s [source]>\n");
   fprintf(stderr, "Destination must be provided\n");
   fprintf(stderr, "Source is optional\n\n");
}

static char* getip()
{
   char buffer[256];
   struct hostent* h;

   gethostname(buffer, 256);
   h = gethostbyname(buffer);

   return inet_ntoa(*(struct in_addr *)h->h_addr);

}

/*
 * return the ip address if host provided by DNS name
 */
static char* toip(char* address)
{
   struct hostent* h;
   h = gethostbyname(address);
   return inet_ntoa(*(struct in_addr *)h->h_addr);
}

/*
 * in_cksum --
 * Checksum routine for Internet Protocol
 * family headers (C Version)
 */
static unsigned short in_cksum(unsigned short *addr, int len)
{
   register int sum = 0;
   u_short answer = 0;
   register u_short *w = addr;
   register int nleft = len;
   /*
    * Our algorithm is simple, using a 32 bit accumulator (sum), we add
    * sequential 16 bit words to it, and at the end, fold back all the
    * carry bits from the top 16 bits into the lower 16 bits.
    */
   while (nleft > 1)
   {
         sum += *w++;
         nleft -= 2;
   }
   /* mop up an odd byte, if necessary */
   if (nleft == 1)
   {
         *(u_char *) (&answer) = *(u_char *) w;
         sum += answer;
   }
   /* add back carry outs from top 16 bits to low 16 bits */
   sum = (sum >> 16) + (sum & 0xffff);         /* add hi 16 to low 16 */
   sum += (sum >> 16);                         /* add carry */
   answer = ~sum;                              /* truncate to 16 bits */
   return (answer);
}

#pragma ENDDUMP
Saludos,



Eduardo
Posts: 883
Joined: Tue Oct 11, 2005 11:57 AM
Re: Hacer Ping a un PC, Como ?
Posted: Tue Jan 18, 2011 08:09 PM

MGSOFT..

Habia visto ese post, pero la solucion es para FIVELINUX, de hecho se incluyen archivos de cabecera que no poseo.

Gracias

;-) Ji,ji,ji... buena la cosa... "all you need is code"

http://www.xdata.cl - Desarrollo Inteligente
----------
Asus TUF F15, 32GB Ram, 2 * 1 TB NVME M.2, GTX 1650
Posts: 601
Joined: Wed Jul 04, 2007 03:51 PM
Re: Hacer Ping a un PC, Como ?
Posted: Tue Jan 18, 2011 08:12 PM

Adolfo...
Recuerda que el Ping tiene el par谩metro -n que sirve para decir que cantidad de intentos quiero hacer.

PING 192.168.1.40 -n 1

S贸lo enviar谩 un solo paquete.
Espero sirva de ayuda.
Saludos,

Ojeda Esteban Eduardo.

Buenos Aires - Argentina.

FWH - PellesC - DBF/CDX - ADS - Gloriosos .Bat - MySql - C# .net - FastReport

Skype: jreduojeda
Posts: 883
Joined: Tue Oct 11, 2005 11:57 AM
Re: Hacer Ping a un PC, Como ?
Posted: Tue Jan 18, 2011 08:28 PM

jrestojeda....

Sip, ya habia caido en eso... al momento parece ser la solucion, ( no la mas esperada, pero creo que funcionara )

A propo, de las funciones de manejo de internet y sockets de xharbour, como no habra por ahi un pedazo de codigo en C que haga la pega... mm voy a bajarme los sources y vere si "adivino" donde estara la solucion... trabajo para la casa.

Saludos.

si alguien encuentra por ahi algo.. envie la solucion sin problemas.

Adolfo

;-) Ji,ji,ji... buena la cosa... "all you need is code"

http://www.xdata.cl - Desarrollo Inteligente
----------
Asus TUF F15, 32GB Ram, 2 * 1 TB NVME M.2, GTX 1650
Posts: 601
Joined: Wed Jul 04, 2007 03:51 PM
Re: Hacer Ping a un PC, Como ?
Posted: Wed Jan 19, 2011 12:30 AM
Adolfo...
Una peque帽a prueba que estuve haciendo...

Code (fw): Select all Collapse
// PRUEBA DE PING //
Function Ping(DestinationAddress)
Local IcmpHandle,Replicas,puerto
Local RequestData 聽 :="Probando ping",;
聽 聽 聽 RequestSize 聽 :=15,;
聽 聽 聽 RequestOptions:="",;
聽 聽 聽 ReplyBuffer 聽 :=SPACE(278),;
聽 聽 聽 ReplySize 聽 聽 :=278,;
聽 聽 聽 Timeout 聽 聽 聽 :=500 && Milisegundos de espera

DEFAULT DestinationAddress := "127.0.0.1"

DestinationAddress:=LEFT(ALLTRIM(DestinationAddress)+SPACE(15),15)

MsgGet("Ping...","Ingrese una direcci贸n IP",@DestinationAddress)

IcmpHandle:=IcmpCreateFile()
Replicas 聽:=IcmpSendEcho(IcmpHandle,;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 inet_addr(DestinationAddress),;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 RequestData,;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 RequestSize,0,;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 ReplyBuffer,;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 ReplySize,;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 Timeout)

IcmpCloseHandle(IcmpHandle)

IF Replicas > 0
聽 聽Msginfo("Respuesta correcta del host "+ALLTRIM(DestinationAddress),"Atenci贸n")
ELSE
聽 聽Msginfo("Host inaccesible"+ALLTRIM(DestinationAddress)+"Atenci贸n")
ENDIF

Return nil
//

DLL32 FUNCTION WSAGetLastError() AS _INT PASCAL FROM "WSAGetLastError" LIB "wsock32.dll"
DLL32 FUNCTION inet_addr(cIP AS STRING) AS LONG PASCAL FROM "inet_addr" LIB "wsock32.dll"
DLL32 FUNCTION IcmpCreateFile() AS LONG PASCAL FROM "IcmpCreateFile" LIB "icmp.dll"
DLL32 FUNCTION IcmpCloseHandle(IcmpHandle AS LONG) AS LONG PASCAL FROM "IcmpCloseHandle" LIB "icmp.dll"
DLL32 FUNCTION IcmpSendEcho(IcmpHandle AS LONG,;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 DestinationAddress AS LONG,;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 RequestData AS STRING,;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 RequestSize AS LONG,;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 RequestOptions AS LONG,;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 ReplyBuffer AS LPSTR,;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 ReplySize AS LONG,;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 Timeout AS LONG) AS LONG PASCAL FROM "IcmpSendEcho" LIB "icmp.dll"
Ojeda Esteban Eduardo.

Buenos Aires - Argentina.

FWH - PellesC - DBF/CDX - ADS - Gloriosos .Bat - MySql - C# .net - FastReport

Skype: jreduojeda
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: Hacer Ping a un PC, Como ?
Posted: Wed Jan 19, 2011 12:03 PM
Esteban

Gracias por el ejemplo, me generaba un error si no inicializaba WinSock aparte tuve que ampliarle el timeout a 1000

Code (fw): Select all Collapse
 聽 if WSAStartup() != 0
聽 聽 聽 聽MsgAlert( "WSAStartup error" )
聽 聽 聽 聽return nil
聽 聽endif


publico un ejemplo funcional usando la funcion de esteban y el equivalente desde C
valores de retorno de hb_ping
0 = Conexion exitosa
1 = IP invalida
2 = No pudo crear el paquete de envio
3 = No pudo crear el buffer de replica
4 = No hay conexion con el host


Code (fw): Select all Collapse
#include "fivewin.ch"

// PRUEBA DE PING //

function main()

聽 聽if WSAStartup() != 0
聽 聽 聽 聽MsgAlert( "WSAStartup error" )
聽 聽 聽 聽return nil
聽 聽endif
聽 聽 聽
聽 聽if hb_Ping( GetHostByName( "www.google.com" ) ) == 0
聽 聽 聽 Msginfo("Respuesta correcta del host " + AllTrim( GetHostByName( "www.google.com" ) ), "Atenci贸n" )
聽 聽else
聽 聽 聽 Msginfo("Host inaccesible" + AllTrim( GetHostByName( "www.google.com" ) ), "Atenci贸n" )
聽 聽endif
聽 
聽 聽Ping( GetHostByName( "www.google.com" ) )
聽 聽
聽 聽WSACleanUp()

聽 聽
return nil


Function Ping(DestinationAddress)
Local IcmpHandle,Replicas,puerto
Local RequestData 聽 :="Probando ping",;
聽 聽 聽 RequestSize 聽 :=15,;
聽 聽 聽 RequestOptions:="",;
聽 聽 聽 ReplyBuffer 聽 :=SPACE(278),;
聽 聽 聽 ReplySize 聽 聽 :=278,;
聽 聽 聽 Timeout 聽 聽 聽 := 1000 && Milisegundos de espera

DEFAULT DestinationAddress := "127.0.0.1"

DestinationAddress:=LEFT(ALLTRIM(DestinationAddress)+SPACE(15),15)

MsgGet("Ping...","Ingrese una direcci贸n IP",@DestinationAddress)

IcmpHandle:=IcmpCreateFile()

Replicas 聽:=IcmpSendEcho(IcmpHandle,;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 inet_addr(DestinationAddress),;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 RequestData,;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 RequestSize,0,;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 ReplyBuffer,;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 ReplySize,;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 Timeout)

IcmpCloseHandle(IcmpHandle)

IF Replicas > 0
聽 聽Msginfo("Respuesta correcta del host "+ALLTRIM(DestinationAddress),"Atenci贸n")
ELSE
聽 聽Msginfo("Host inaccesible"+ALLTRIM(DestinationAddress)+"Atenci贸n")
ENDIF

Return nil
//

DLL32 FUNCTION WSAGetLastError() AS _INT PASCAL FROM "WSAGetLastError" LIB "wsock32.dll"
DLL32 FUNCTION inet_addr(cIP AS STRING) AS LONG PASCAL FROM "inet_addr" LIB "wsock32.dll"
DLL32 FUNCTION IcmpCreateFile() AS LONG PASCAL FROM "IcmpCreateFile" LIB "icmp.dll"
DLL32 FUNCTION IcmpCloseHandle(IcmpHandle AS LONG) AS LONG PASCAL FROM "IcmpCloseHandle" LIB "icmp.dll"
DLL32 FUNCTION IcmpSendEcho(IcmpHandle AS LONG,;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 DestinationAddress AS LONG,;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 RequestData AS STRING,;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 RequestSize AS LONG,;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 RequestOptions AS LONG,;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 ReplyBuffer AS LPSTR,;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 ReplySize AS LONG,;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 Timeout AS LONG) AS LONG PASCAL FROM "IcmpSendEcho" LIB "icmp.dll"

#pragma BEGINDUMP
#include <hbapi.h> 
#include <winsock2.h>
#include <iphlpapi.h>
#include <icmpapi.h>

int hb_Ping( const char * cp )
{
聽 聽 HANDLE hIcmpFile;
聽 聽 unsigned long ipaddr;
聽 聽 DWORD dwRetVal;
聽 聽 char SendData[32] = "Data Buffer";
聽 聽 LPVOID ReplyBuffer;
聽 聽 DWORD ReplySize;

聽 聽 ipaddr = inet_addr( cp );
聽 聽 if (ipaddr == INADDR_NONE)
聽 聽 聽 聽 return 1;
聽 聽 
聽 聽 hIcmpFile = IcmpCreateFile();
聽 聽 if (hIcmpFile == INVALID_HANDLE_VALUE)
聽 聽 聽 聽 return 2;

聽 聽 ReplySize = sizeof(ICMP_ECHO_REPLY) + sizeof(SendData);
聽 聽 ReplyBuffer = (VOID*) malloc(ReplySize);
聽 聽 if (ReplyBuffer == NULL)
聽 聽 聽 聽 return 3;
聽 聽 
聽 聽 
聽 聽 dwRetVal = IcmpSendEcho(hIcmpFile, ipaddr, SendData, sizeof(SendData), 
聽 聽 聽 聽 NULL, ReplyBuffer, ReplySize, 1000);

聽 聽 if (dwRetVal == 0)
聽 聽 聽 聽 return 4;
聽 聽 
聽 聽 return 0;

}


HB_FUNC( HB_PING )
{
聽 聽hb_retni( hb_Ping( hb_parc( 1 ) ) );
}

#pragma ENDDUMP
Posts: 883
Joined: Tue Oct 11, 2005 11:57 AM
Re: Hacer Ping a un PC, Como ?
Posted: Wed Jan 19, 2011 01:29 PM

Ya habia probado con el Bat y las velocidad de prueba es normal.

Pruebo con esta funcion y comento..

Gracias a Todos

Desde Chile
Adolfo

;-) Ji,ji,ji... buena la cosa... "all you need is code"

http://www.xdata.cl - Desarrollo Inteligente
----------
Asus TUF F15, 32GB Ram, 2 * 1 TB NVME M.2, GTX 1650
Posts: 883
Joined: Tue Oct 11, 2005 11:57 AM
Re: Hacer Ping a un PC, Como ?
Posted: Wed Jan 19, 2011 02:00 PM

Tengo 2 errores.

Unresolved external : IcmpCreateFile()
Unresolved external : IcmpSendEcho()

Recuerden que utilizo xHarbour for BCC5.8.2 1.2.1 Rev 6741

PD: En Windows 7 Ultimate

Saludos
Adolfo

;-) Ji,ji,ji... buena la cosa... "all you need is code"

http://www.xdata.cl - Desarrollo Inteligente
----------
Asus TUF F15, 32GB Ram, 2 * 1 TB NVME M.2, GTX 1650
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: Hacer Ping a un PC, Como ?
Posted: Wed Jan 19, 2011 02:06 PM

Adolfo...

te falta enlazar iphlpapi.lib de borland

Posts: 883
Joined: Tue Oct 11, 2005 11:57 AM
Re: Hacer Ping a un PC, Como ?
Posted: Wed Jan 19, 2011 02:23 PM

Daniel... upsss tienes razon

Grax

Funciona de maravillas y mas rapido que usando el Bat.

Consulto 3 Ip's en menos de 3 segundos

Gracias a Todos

;-) Ji,ji,ji... buena la cosa... "all you need is code"

http://www.xdata.cl - Desarrollo Inteligente
----------
Asus TUF F15, 32GB Ram, 2 * 1 TB NVME M.2, GTX 1650
Posts: 601
Joined: Wed Jul 04, 2007 03:51 PM
Re: Hacer Ping a un PC, Como ?
Posted: Wed Jan 19, 2011 02:47 PM

Hola...
Daniel, que bueno que la funci贸n sirvi贸 como punto de partida. A prop贸sito, te comento que yo con Windows XP con el TimeOut de 500 milisegundos no tengo problemas. Quizas sea porque s贸lo hice pruebas en LAN.

Adolfo, que bueno que lo solucionaste.

Saludos a ambos.

Ojeda Esteban Eduardo.

Buenos Aires - Argentina.

FWH - PellesC - DBF/CDX - ADS - Gloriosos .Bat - MySql - C# .net - FastReport

Skype: jreduojeda
Posts: 711
Joined: Thu Oct 06, 2005 09:57 PM
Re: Hacer Ping a un PC, Como ?
Posted: Mon Jul 01, 2013 06:30 AM

A帽adir que para Windows-7 es necesario hacer un Loadlib32("iphlpapi.dll"). En caso contrario, se cuelga.

Un saludo



Manuel