コード例 #1
0
        private void btnGetBoxResults_Click(object sender, EventArgs e)
        {
            var strURL = @"https://en.wikipedia.org/wiki/Boxing_at_the_1948_Summer_Olympics_%E2%80%93_Men%27s_heavyweight";

            dgvBoxResult.DataSource = HtmlTableParser.BoxResultPrepare(HtmlTableParser.GetDataTablesFromHtml(tbxURL.Text).Tables[3]);
            //  dgvBoxResult.DataSource = (HtmlTableParser.GetDataTablesFromHtml(strURL).Tables[3]);

            if (saveFileDialog.ShowDialog() == DialogResult.OK)
            {
                DataWriter.SaveDGVToCSVfile(saveFileDialog.FileName, dgvBoxResult);
                MessageBox.Show("Данные сохранены");
            }
        }
コード例 #2
0
        private void btnGetTabs_Click(object sender, EventArgs e)
        {
            dataSet = HtmlTableParser.GetDataTablesFromHtml(tbxURL.Text);
            cbxTabNumber.Items.Clear();
            while (cbxTabNumber.Items.Count < dataSet.Tables.Count)
            {
                cbxTabNumber.Items.Add(cbxTabNumber.Items.Count + 1);
            }

            if (cbxTabNumber.Items.Count > 0)
            {
                cbxTabNumber.SelectedIndex = 0;
            }
        }