private void button6_Click(object sender, EventArgs e) { if (this.dataNRule.Rows.Count == 0) { MessageBox.Show(rm.GetString("Error5"), rm.GetString("MessageboxError"), MessageBoxButtons.OK, MessageBoxIcon.Information); return; } List <cNavigRule> cns = new List <cNavigRule>(); cNavigRule cn; for (int m = 0; m < this.dataNRule.Rows.Count; m++) { cn = new cNavigRule(); cn.Url = this.txtWebLink.Text; cn.Level = int.Parse(this.dataNRule.Rows[m].Cells[0].Value.ToString()); cn.NavigRule = this.dataNRule.Rows[m].Cells[1].Value.ToString(); cns.Add(cn); } string Url = GetTestUrl(this.txtWebLink.Text, cns); if (!Regex.IsMatch(Url, @"(http|https|ftp)+://[^\s]*")) { MessageBox.Show(rm.GetString("Error6"), rm.GetString("MessageboxInfo"), MessageBoxButtons.OK, MessageBoxIcon.Information); return; } System.Diagnostics.Process.Start(Url); }
private void cmdTest_Click(object sender, EventArgs e) { if (this.txtNRule.Text == "") { MessageBox.Show(rm.GetString("Error5"), rm.GetString("MessageboxInfo"), MessageBoxButtons.OK, MessageBoxIcon.Information); return; } string Url = ""; try { this.txtTestUrl.Text = ""; List <cNavigRule> cns = new List <cNavigRule>(); cNavigRule cn; cn = new cNavigRule(); cn.Url = this.txtNRule.Text; cn.Level = 1; cn.NavigRule = this.txtNRule.Text; cns.Add(cn); GetTestUrl(this.txtDemoUrl.Text, cns); } catch (System.Exception ex) { MessageBox.Show(rm.GetString("Error26"), rm.GetString("MessageboxError"), MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void button1_Click(object sender, EventArgs e) { int UrlCount = 0; cNavigRules m_listNaviRule = new cNavigRules(); if (this.txtWebLink.Text.ToString() == null || this.txtWebLink.Text.Trim().ToString() == "" || this.txtWebLink.Text.Trim().ToString() == "http://") { MessageBox.Show(rm.GetString("Error1"), rm.GetString("MessageboxInfo"), MessageBoxButtons.OK, MessageBoxIcon.Information); this.txtWebLink.Focus(); return; } else { if (!Regex.IsMatch(this.txtWebLink.Text.Trim().ToString(), "http://", RegexOptions.IgnoreCase)) { MessageBox.Show(rm.GetString("Error2"), rm.GetString("MessageboxInfo"), MessageBoxButtons.OK, MessageBoxIcon.Information); this.txtWebLink.Focus(); return; } } ListViewItem litem; litem = new ListViewItem(); litem.Text = this.txtWebLink.Text.ToString(); if (this.IsNavigPage.Checked == true) { litem.SubItems.Add("Y"); cNavigRule cn; for (int m = 0; m < this.dataNRule.Rows.Count; m++) { cn = new cNavigRule(); cn.Url = this.txtWebLink.Text; cn.Level = m + 1; cn.NavigRule = this.dataNRule.Rows[m].Cells[1].Value.ToString(); m_listNaviRule.Url = this.txtWebLink.Text; m_listNaviRule.NavigRule.Add(cn); } litem.SubItems.Add(this.dataNRule.Rows.Count.ToString()); } else { litem.SubItems.Add("N"); litem.SubItems.Add("0"); } if (this.IsAutoNextPage.Checked == true) { litem.SubItems.Add(this.txtNextPage.Text.ToString()); } else { litem.SubItems.Add(""); } UrlCount = gUrl.GetUrlCount(this.txtWebLink.Text.ToString()); litem.SubItems.Add(UrlCount.ToString()); rData(litem, m_listNaviRule); this.Close(); }