}
//输入IP
public static string InputHostIP()
{
Console.Write("enter the ip you want to scan:\n\n";
string hostip =Console.ReadLine();
Console.Write(‘\n‘);
return hostip;
}
//EXIT
public static void Exit()
{
Console.WriteLine("if you want to exit ,just input 1\n";
int a = Console.Read();
if(a!= 1)
{
Console.WriteLine("if you want to exit ,just input 1\n";
Console.Read();
}
else
{
}
}
[STAThread]
static void Main(string[] args)
{
string HostIP;
HostIP = InputHostIP();
Console.WriteLine("Begin to send udp to the host";
m_Client = new UdpClient();
Send(HostIP);
string strData=Listen(HostIP);
OutputInfo(strData);
Exit();