private void button1_Click(object sender, System.EventArgs e) { memResult.Text = ""; http1.UserName = edtUser.Text; http1.Password = edtPassword.Text; http1.FirewallSettings.Server = ""; http1.ProxySettings.Server = ""; if (cbProxyType.SelectedIndex == 0) { http1.ProxySettings.Server = edtProxyServer.Text; http1.ProxySettings.Port = Convert.ToInt32(edtProxyPort.Text); http1.ProxySettings.UserName = edtProxyUser.Text; http1.ProxySettings.Password = edtProxyPassword.Text; } else { if (cbProxyType.SelectedIndex == 1) { http1.FirewallSettings.FirewallType = FirewallType.Socks4; } else { http1.FirewallSettings.FirewallType = FirewallType.Socks5; } http1.FirewallSettings.Server = edtProxyServer.Text; http1.FirewallSettings.Port = Convert.ToInt32(edtProxyPort.Text); http1.FirewallSettings.UserName = edtProxyUser.Text; http1.FirewallSettings.Password = edtProxyPassword.Text; } try { if (cbShowText.Checked) { htmlParser1.Parse(http1.Get(edtUrl.Text)); } else { memResult.Lines = http1.Get(edtUrl.Text); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void button1_Click(object sender, System.EventArgs e) { memResult.Text = ""; try { if (cbShowText.Checked) { htmlParser1.Parse(http1.Get(edtUrl.Text)); } else { memResult.Text = http1.Get(edtUrl.Text); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
protected void Button1_Click(object sender, System.EventArgs e) { string[] html = http1.Get(edtUrl.Text); htmlparser1.Parse(html); DataTable links = new DataTable(); links.Columns.Add("Url"); foreach (CleverComponents.InetSuite.HtmlLink link in htmlparser1.Links) { DataRow row = links.NewRow(); row["Url"] = link.Href; links.Rows.Add(row); } DataGrid1.DataSource = links; DataGrid1.DataBind(); }