Beispiel #1
0
        private string UDPScan(int port, IPEndPoint ipEnd)
        {
            try
            {
                var udpcl = new UdpConnectCall(Convert.ToInt32(textBox6.Text));
                udpcl.Connect(ipEnd);
                return(string.Format("{0} is opened\n", port));
            }
            catch (Exception ex)
            {
                switch (ex.Message)
                {
                case "CLOSED":
                    return(string.Format("{0} is closed\n", port));

                    break;

                case "TIME_OUT":
                    return(string.Format("{0} is open/filtered\n", port));

                    break;

                default:
                    break;
                }
            }
            return(null);
        }
Beispiel #2
0
 private string UDPScan(int port, IPEndPoint ipEnd)
 {
     try
     {
         var udpcl = new UdpConnectCall(Convert.ToInt32(textBox6.Text));
         udpcl.Connect(ipEnd);
         return (string.Format("{0} is opened\n", port));
     }
     catch (Exception ex)
     {
         switch (ex.Message)
         {
             case "CLOSED":
                 return (string.Format("{0} is closed\n", port));
                 break;
             case "TIME_OUT":
                 return (string.Format("{0} is open/filtered\n", port));
                 break;
             default:
                 break;
         }
     }
     return null;
 }