Erro ao Dar um Ping
27/08/2013
0
function ExecutaPing(HostName: String): boolean; var PckEntregue : Array[1..3] of Integer; ICMP : TIdIcmpClient; begin try ICMP := TIdIcmpClient.Create(nil); try ICMP.Host := HostName; ICMP.ReceiveTimeout := 500; ICMP.Ping; if ICMP.ReplyStatus.BytesReceived > 0 then result := true else result := false; except result := false; end; finally ICMP.Destroy; end; end;
no D2010 funciona certinho no XE4 m retornar o erro Socket Error 10040 message too long
alguem saberia m dizer oq pode ser isso...
Laelson Fagundes
Posts
27/08/2013
Wilson Oliveira
Compile o projeto e tente executar o executavel como administrador e veja se o problema persiste.
sds
arreegua
27/08/2013
Wilson Oliveira
Compile o projeto e tente executar o executavel como administrador e veja se o problema persiste.
sds
arreegua
27/08/2013
Laelson Fagundes
27/08/2013
Laelson Fagundes
27/08/2013
Wilson Oliveira
Vai no exe compilado e botão direito e executar como admin .
Se nao der tenta setar a propriedade packetsize para um valor menor.
Mas tenta executar como admin nao custa nada e elimina uma variável . Estava dando esse erro ara mim, Windows 7 Delphi xe3 , executando comi admin funcionou para mim
13/10/2013
José
13/10/2013
Laelson Fagundes
Mas fiz uma gambiarrinha e por um periodo funcionou mas é muito relevante as vezes ele retorna o erro mas tem momentos q não so q no Delphi 2010 funciona 100% com a função acima:
para funcionar no EX 4 estava usando da seguinte forma:
function ExecutaPing(HostName: String): boolean; var PckEntregue : Array[1..3] of Integer; ICMP : TIdIcmpClient; ABuffer: String; begin try //Adicionado o Buffer para resolver o problema com o Delphi XE4 //ABuffer:=HostName+StringOfChar(' ',255); ICMP := TIdIcmpClient.Create(nil); try ICMP.PacketSize := 32; ICMP.Host := HostName; ICMP.ReceiveTimeout := 500; ICMP.Ping;//(ABuffer); if ICMP.ReplyStatus.BytesReceived > 0 then result := true else result := false; except result := false; end; finally ICMP.Destroy; end; end;
25/06/2022
Joel Realino
Compile o projeto e tente executar o executavel como administrador e veja se o problema persiste.
sds
arreegua
Clique aqui para fazer login e interagir na Comunidade :)