1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
#include "StdAfx.h"
#include "pingage.h"
#include "Impressions.h"
using namespace System;
using namespace System::IO;
using namespace System::Text;
using namespace System::Windows::Forms;
using namespace System::Net;
using namespace System::Net::NetworkInformation;
namespace Ping
{
void pingage::Pingueur(String^adresse, int timeout)
{
Impressions::PrintHead_pingres();
for (int i=0; i<4;i++)
{
Ping^ monPing = gcnew Ping();
PingReply^ reply = monPing->Send(adresse,timeout);
String^ temps=((reply->RoundtripTime).ToString()+"s");
Impressions::Print_PingRes(adresse, temps, reply->Status);
}
}
} |