Bonjour,
Je veux faire un PIng sur un poste de travail, j'ai pris mon code sur internet.
Mais je ne comprends pas pourquoi ma ligne de code ou il y a mon ReplyStatus me donne l'erreur
Cannot access protected symbol TIdCumstomIcmpClient.ReplyStatus.
Merci
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 function TFCoupeAcier_45_90.Ping(const AHost : string) : Boolean; var MyIdIcmpClient : TIdIcmpClient; begin Result := True; MyIdIcmpClient := TIdIcmpClient.Create(nil); MyIdIcmpClient.ReceiveTimeout := 200; MyIdIcmpClient.Host := AHost; try MyIdIcmpClient.Ping; //Application.ProcessMessages; except Result := False; MyIdIcmpClient.Free; Exit; end; if MyIdIcmpClient.ReplyStatus.ReplyStatusType <> rsEcho Then result := False; MyIdIcmpClient.Free; end;
Partager