/// <summary> /// 下一步 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void GetUp(object sender, EventArgs e) { try { if (dataGridViewData.Rows.Count > 0) { taskInfoEntity.urlListEntity.UrlDataSource = dataGridViewData; object elementNode = dataGridViewData.Rows[0].Cells["VisibleGeckofxElement"].Value; string url = GeckofxConverInfo.GetUrlByElement(elementNode); GeckofxWebbrowerFrm geckofxWebbrowerFrm = new GeckofxWebbrowerFrm(taskInfoEntity, dgv, GeckofxWebbrowerType.General, url); geckofxWebbrowerFrm.FormBorderStyle = FormBorderStyle.None; geckofxWebbrowerFrm.TopLevel = false; //这个必须有不然会提示:"不能向tabControl中添加顶级控件" geckofxWebbrowerFrm.Dock = DockStyle.Fill; geckofxWebbrowerFrm.Show(); //这个必须有,不然显示不出来 this.splitterPanel.Controls.Add(geckofxWebbrowerFrm); } else { MessageBox.Show("您还没有选择需要抓取详细页的链接地址!"); return; } } catch (Exception) { MessageBox.Show("信息填写有误!"); } tabControl.SelectedIndex = ++tabControl.SelectedIndex; }
/// <summary> /// 下一步 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void GetUp(object sender, EventArgs e) { try { taskInfoEntity.taskURL = taskURLWaterTextBox.Text; GeckofxWebbrowerFrm geckofxWebbrowerFrm = new GeckofxWebbrowerFrm(taskInfoEntity, dgv, GeckofxWebbrowerType.UrlModel); geckofxWebbrowerFrm.FormBorderStyle = FormBorderStyle.None; geckofxWebbrowerFrm.TopLevel = false; //这个必须有不然会提示:"不能向tabControl中添加顶级控件" geckofxWebbrowerFrm.Dock = DockStyle.Fill; geckofxWebbrowerFrm.Show(); //这个必须有,不然显示不出来 this.splitterPanel.Controls.Add(geckofxWebbrowerFrm); } catch (Exception) { MessageBox.Show("信息填写有误!"); } tabControl.SelectedIndex = ++tabControl.SelectedIndex; }