百度空间链接分析

通过孟繁永

百度空间链接分析

string input = "";
        if (!string.IsNullOrEmpty(TextBox1.Text))
        {
            input = TextBox1.Text.Trim();  
        }
        string html = HtmlHandle.GetHtml(input, 8000, 0, Encoding.GetEncoding("gb2312"));
        string ptn = @"<span id=""linkArea"">.*?""(?<link>.*?)"",""(?<title>.*?)"",""(?<subtitle>.*?)"".*?</span>";

        string res = "";

        MatchCollection mc = Regex.Matches(html, ptn, RegexOptions.ExplicitCapture);
        foreach (Match ma in mc)
        {
            res = res + "<a href=" + ma.Groups["link"].Value + " title= " + ma.Groups["subtitle"].Value+">" + ma.Groups["title"].Value + "</a><br/>" ;
        }
        Literal1.Text = res;

关于作者

孟繁永 administrator

发表评论

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据