Пример #1
0
        public IToolResults Run()
        {
            string cmd, output;

            cmd = _options.Host;

            ProcessStartInfo si = new ProcessStartInfo();

            si.RedirectStandardOutput = true;
            si.UseShellExecute        = false;

            Process proc = new Process();

            proc.StartInfo           = si;
            proc.EnableRaisingEvents = false;
            proc.StartInfo.FileName  = _options.Path;
            proc.StartInfo.Arguments = cmd;
            proc.Start();

            output = proc.StandardOutput.ReadToEnd();

            proc.WaitForExit();

            TracerouteToolResults results = new TracerouteToolResults(output);

            return(results);
        }
        public PersistentTracerouteResults(TracerouteToolResults results)
        {
            this.PersistentRoutes = new List<PersistentRoute>();

            foreach (var route in results.Routes)
            {
                PersistentRoute pr = new PersistentRoute(route);
                pr.SetCreationInfo(Guid.Empty);
                this.PersistentRoutes.Add(pr);
            }

            this.FullOutput = results.FullOutput;
        }
Пример #3
0
        public IToolResults Run()
        {
            string cmd, output;

            cmd = _options.Host;

            ProcessStartInfo si = new ProcessStartInfo();
            si.RedirectStandardOutput = true;
            si.UseShellExecute = false;

            Process proc = new Process();

            proc.StartInfo = si;
            proc.EnableRaisingEvents = false;
            proc.StartInfo.FileName = _options.Path;
            proc.StartInfo.Arguments = cmd;
            proc.Start();

            output = proc.StandardOutput.ReadToEnd();

            proc.WaitForExit();

            TracerouteToolResults results = new TracerouteToolResults(output);

            return results;
        }