Ejemplo n.º 1
0
        private void buttonStart_Click(object sender, EventArgs e)
        {
            if (!newSessionBtn.Checked)
            {
                filePath           = SessionCotroller.Session.FilePath;
                filePathLabel.Text = filePath;
            }
            else
            {
                SessionCotroller.CreateNew();
            }

            if (filePath == "" || filePath == null)
            {
                richTextBox.AppendText(new string('-', 50));
                richTextBox.AppendText("\nФайл не выбран\n");
                richTextBox.AppendText(new string('-', 50));
            }
            else
            {
                buttonStart.Enabled = false;
                buttonStop.Enabled  = true;
                progressBar.Value   = progressBar.Minimum;
                resultBox.Clear();
                canceled = false;

                Output.Write("File: " + filePath);

                ThreadPool.QueueUserWorkItem(_ =>
                {
                    DoTraceRoute();
                    Requester.LoadDomains();
                    Requester.LoadStubs();

                    ThreadPool.QueueUserWorkItem(__ =>
                    {
                        Work();
                    });
                });
            }
        }
Ejemplo n.º 2
0
        public MainForm()
        {
            InitializeComponent();

            Logger.ShowLog    += ConsoleWriteLine;
            Output.ShowResult += PrintResult;

            SessionCotroller.Initialize();

            SessionCotroller.CreateNew();
            newSessionBtn.Checked = true;

            LoadSession();
            SessionList.ClearSelected();
            newSessionBtn.Checked = true;
            sessionFile.Text      = "";

            LoadFilters();
            timeOutInput.Value = 3;
            domainPingBox.Text = "ya.ru";
            providerName       = ProviderNameBox.Text;
            canceled           = false;
        }