示例#1
0
        private void Begin_Click(object sender, EventArgs e)
        {
            string host = HostBox.Text;

            if (host == null || host == "")
            {
                host = @"ru.wikibooks.org";
            }

            int num = 0;

            if (!int.TryParse(NumericBox.Text, out num))
            {
                num = 0;
            }

            string path = @"D:\текст";

            if (PathBox.Text != null && PathBox.Text != "")
            {
                path = PathBox.Text;
            }

            webRobot = new WebRobot(host, 2, path, num);
            task     = new Task(() => webRobot.BeginSite());
            task.Start();

            BeginBox.Visible = false;
            PauseBox.Visible = true;
        }
示例#2
0
        private void DeserialezeBt_Click(object sender, EventArgs e)
        {
            try
            {
                string path = @"D:\текст";
                if (PathBox.Text != null && PathBox.Text != "")
                {
                    path = PathBox.Text;
                }

                webRobot = new WebRobot(path, 2);
                task     = new Task(() => webRobot.BeginSite());
                task.Start();

                BeginBox.Visible = false;
                PauseBox.Visible = true;
            }
            catch
            {
                MessageBox.Show("Ошибка");
            }
        }