/// <summary>
        /// Runs property autodetection.
        /// </summary>
        /// <returns>Return true if the function is succeeded.</returns>
        public bool RunDetection()
        {
            if (!PingSUT())
            {
                return(false);
            }

            RDPDetector detector = new RDPDetector(detectionInfo);

            if (!detector.DetectRDPFeature())
            {
                detector.Dispose();
                return(false);
            }
            detector.Dispose();
            return(true);
        }
        /// <summary>
        /// Runs property autodetection.
        /// </summary>
        /// <returns>Return true if the function is succeeded.</returns>
        public bool RunDetection()
        {
            try
            {
                if (!DetectSUTIPAddress())
                {
                    return(false);
                }

                using (var detector = new RDPDetector(detectionInfo))
                {
                    if (!detector.DetectRDPFeature())
                    {
                        return(false);
                    }
                }
                return(true);
            }
            catch (Exception ex)
            {
                DetectorUtil.WriteLog(String.Format("RunDetection() threw exception: {0}", ex));
                return(false);
            }
        }
示例#3
0
        /// <summary>
        /// Runs property autodetection.
        /// </summary>
        /// <returns>Return true if the function is succeeded.</returns>
        public bool RunDetection(DetectContext context)
        {
            logWriter.ApplyDetectContext(context);
            try
            {
                if (context.Token.IsCancellationRequested)
                {
                    return(false);
                }

                if (!DetectSUTIPAddress())
                {
                    return(false);
                }

                if (context.Token.IsCancellationRequested)
                {
                    return(false);
                }

                using (var detector = new RDPDetector(detectionInfo, logWriter))
                {
                    if (!detector.DetectRDPFeature())
                    {
                        return(false);
                    }
                }
                return(true);
            }
            catch (Exception ex)
            {
                logWriter.AddLog(DetectLogLevel.Warning, "Failed", false, LogStyle.StepFailed);
                logWriter.AddLog(DetectLogLevel.Error, ex.Message);
                return(false);
            }
        }