📄 start_catch.aspx.cs
字号:
// for (int i = int.Parse(usemyurl[1]); i <= int.Parse(usemyurl[2]); i++)
// {
// string okurl = usemyurl[0].Replace("[var]", i.ToString());
// HttpWebRequest adsdf = (HttpWebRequest)WebRequest.Create(okurl);
// HttpWebResponse aaaaaaaaa = (HttpWebResponse)adsdf.GetResponse();
// Stream strm = aaaaaaaaa.GetResponseStream();
// StreamReader sr = new StreamReader(strm, Encoding.GetEncoding(myds.Tables[0].Rows[0][3].ToString().Trim()));
// string dataHTML = sr.ReadToEnd();
// StripHTML(dataHTML);
// strm.Close();
// }
//this.Label6.Text = "列表采集完成";
// //this.Button2.Visible = true;
//}
//catch
//{
//}
// }
// }
}
//public void StripHTML(string strHtml)
//{
// link = new ArrayList();
// title = new ArrayList();
// ArrayList enddata = new ArrayList();
// ArrayList endlink = new ArrayList();
// linktedian = new ArrayList();
// linkteddian1 = new ArrayList();
// try
// {
// string strOutput = strHtml.Substring(strHtml.IndexOf(myds.Tables[0].Rows[0][4].ToString().Trim()));
// strOutput = strOutput.Substring(0, strOutput.IndexOf(myds.Tables[0].Rows[0][6].ToString().Trim()));
// Regex regex = new Regex("<a([\\S\\s]*?)</a>");
// MatchCollection matches = regex.Matches(strOutput);
// System.Collections.IEnumerator enu = matches.GetEnumerator();
// while (enu.MoveNext() && enu.Current != null)
// {
// Match match = (Match)(enu.Current);
// string content = match.Value;
// linkteddian1.Add(content);
// Regex regex1 = new Regex("[^\x00-\xff]</a>");
// MatchCollection matches1 = regex1.Matches(content);
// System.Collections.IEnumerator enu1 = matches1.GetEnumerator();
// while (enu1.MoveNext() && enu1.Current != null)
// {
// Match match1 = (Match)(enu1.Current);
// enddata.Add(match.Value);
// }
// }
// int n = 0;
// for (int i = 0; i < linkteddian1.Count; i++)
// {
// for (int j = 0; j < enddata.Count; j++)
// {
// if (linkteddian1[i].ToString() == enddata[j].ToString())
// {
// n++;
// break;
// }
// }
// if (n == 0)
// {
// enddata.Add(linkteddian1[i]);
// }
// n = 0;
// }
// for (int i = 0; i < enddata.Count; i++)
// {
// if (myds.Tables[0].Rows[0][2].ToString().Trim() != "")
// {
// if (enddata[i].ToString().IndexOf(myds.Tables[0].Rows[0][2].ToString().Trim()) != -1)
// {
// linktedian.Add(enddata[i]);
// }
// }
// }
// string[] sub;
// string usesub;
// ArrayList useenddata = new ArrayList();
// for (int i = 0; i < linktedian.Count; i++)
// {
// sub = linktedian[i].ToString().Split('>', '<');
// usesub = sub[2];
// if (usesub == "")
// {
// }
// else if (char.IsNumber(usesub, 0))
// {
// }
// else
// {
// useenddata.Add(linktedian[i]);
// }
// }
// ArrayList wei = new ArrayList();
// for (int i = 0; i < useenddata.Count; i++)
// {
// string atitle = useenddata[i].ToString().Substring(0, useenddata[i].ToString().IndexOf('>') + 1);
// string awei = useenddata[i].ToString().Substring(useenddata[i].ToString().LastIndexOf('<'));
// string metton = useenddata[i].ToString().Substring(useenddata[i].ToString().IndexOf('>') + 1, useenddata[i].ToString().LastIndexOf('<') - useenddata[i].ToString().IndexOf('>') - 1);
// Regex regex2 = new Regex(@"(<|&)([\S\s]*?)(;|>)");
// MatchCollection matches2 = regex2.Matches(metton);
// string content = metton; ;
// System.Collections.IEnumerator enu2 = matches2.GetEnumerator();
// while (enu2.MoveNext() && enu2.Current != null)
// {
// Match match = (Match)(enu2.Current);
// content = content.Remove(content.IndexOf(match.Value), match.Value.Length);
// }
// if (content != "")
// {
// wei.Add(atitle + content + awei);
// }
// else
// {
// wei.Add(atitle + metton + awei);
// }
// }
// if (myds.Tables[0].Rows[0][2].ToString().Trim() != "")
// {
// for (int i = 0; i < wei.Count; i++)
// {
// string uselink = wei[i].ToString().Trim().Substring(wei[i].ToString().IndexOf("href=\"") + 6);
// string tttlink = uselink.Substring(0, uselink.IndexOf("\""));
// link.Add(tttlink);
// }
// for (int i = 0; i < wei.Count; i++)
// {
// string mytitle = wei[i].ToString().Substring(wei[i].ToString().Trim().IndexOf('>') + 1, wei[i].ToString().Trim().LastIndexOf('<') - wei[i].ToString().Trim().IndexOf('>') - 1);
// title.Add(mytitle.Replace("'", ""));
// }
// string[] domain = myds.Tables[0].Rows[0][5].ToString().Split('/');
// for (int i = 0; i < wei.Count; i++)
// {
// if (link[i].ToString().IndexOf("http:") != -1)
// {
// savedata.arctitle.Add(title[i]);
// savedata.linkstor.Add("");
// ListBox1.Items.Add(link[i] + " " + title[i]);
// }
// else
// {
// string[] testqlink = link[i].ToString().Split('.');
// string[] qlink = testqlink[0].Split('-');
// savedata.arctitle.Add(title[i]);
// savedata.linkstor.Add(qlink[1]);
// ListBox1.Items.Add("http://" + domain[2] + "/" + link[i] + " " + title[i]);
// }
// }
// }
// }
// catch
// {
// }
//}
//public bool opendb()
//{
// try
// {
// con = new SqlConnection("server=.;database=catch;uid=sa;pwd=2107855");
// con.Open();
// return true;
// }
// catch
// {
// }
// return false;
//}
//public DataSet Getdata(string sql)
//{
// if (opendb())
// {
// da = new SqlDataAdapter();
// da.SelectCommand = new SqlCommand();
// da.SelectCommand.Connection = con;
// da.SelectCommand.CommandText = sql;
// ds = new DataSet();
// da.Fill(ds);
// return ds;
// }
// return null;
//}
//protected void ListBox1_SelectedIndexChanged(object sender, EventArgs e)
//{
// this.TextBox1.Text = pub();
//}
//public string pub()
//{
// if (this.Label5.Text == "搜狗")
// {
// string[] value1 = ListBox1.SelectedItem.Text.Split(' ');
// this.TextBox2.Text = value1[value1.Length - 1];
// try
// {
// ArrayList enddata = new ArrayList();
// HttpWebRequest adsdfa = (HttpWebRequest)WebRequest.Create(value1[0]);
// HttpWebResponse aaaa = (HttpWebResponse)adsdfa.GetResponse();
// Stream strmeam = aaaa.GetResponseStream();
// StreamReader srea = new StreamReader(strmeam, Encoding.GetEncoding(myds.Tables[0].Rows[0][3].ToString().Trim()));
// string usedataHTML = srea.ReadToEnd();
// string strOutput = usedataHTML.Substring(usedataHTML.IndexOf("form"));
// string a = "";
// string b = "";
// string c = "";
// Regex regex = new Regex("<table([\\S\\s]*?)</table>");
// MatchCollection matches = regex.Matches(strOutput);
// System.Collections.IEnumerator enu = matches.GetEnumerator();
// while (enu.MoveNext() && enu.Current != null)
// {
// Match match = (Match)(enu.Current);
// a += match.Value;
// break;
// }
// string str = a.Substring(a.IndexOf(guize2) + guize2.Length);
// Regex regex1 = new Regex("<div([\\S\\s]*?)</div>");
// MatchCollection matches1 = regex1.Matches(str);
// System.Collections.IEnumerator enu1 = matches1.GetEnumerator();
// while (enu1.MoveNext() && enu1.Current != null)
// {
// Match match1 = (Match)(enu1.Current);
// b += match1.Value;
// Regex usereg = new Regex(@"\(([\S\s]*?)\)");//|([attach([\S\s]*?)[/attach])
// MatchCollection usematch = usereg.Matches(b);
// System.Collections.IEnumerator useenu = usematch.GetEnumerator();
// while (useenu.MoveNext() && useenu.Current != null)
// {
// Match usemymatch = (Match)(useenu.Current);
// c += usemymatch.Value;
// b = b.Remove(b.IndexOf(usemymatch.Value), usemymatch.Value.Length);
// }
// usereg = new Regex(@"<([\S\s]*?)>");//|([attach([\S\s]*?)[/attach])
// usematch = usereg.Matches(b);
// useenu = usematch.GetEnumerator();
// while (useenu.MoveNext() && useenu.Current != null)
// {
// Match usemymatch = (Match)(useenu.Current);
// c += usemymatch.Value;
// b = b.Remove(b.IndexOf(usemymatch.Value), usemymatch.Value.Length);
// if (usemymatch.Value.StartsWith("<img"))
// {
// Regex usereg1 = new Regex("\"([\\S\\s]*?).gif\"");//|([attach([\S\s]*?)[/attach])
// MatchCollection usematch1 = usereg1.Matches(usemymatch.Value);
// System.Collections.IEnumerator useenu1 = usematch1.GetEnumerator();
// while (useenu1.MoveNext() && useenu1.Current != null)
// {
// Match usemymatch1 = (Match)(useenu1.Current);
// c += usemymatch1.Value;
// string img = "[img]http://bbs.sougou.com/" + usemymatch1.Value + "[/img]";
// b += img.Remove(img.IndexOf("\""), 1).Remove(img.LastIndexOf("\"") - 1, 1);
// }
// }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -