private string GetSomeThingFromHtml(string url)
        {
            try
            {
               
                HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
                HttpWebResponse response = (HttpWebResponse)request.GetResponse();
                using (Stream newStream = response.GetResponseStream())
                {
                    using (StreamReader reader = new StreamReader(newStream))
                    {
                        Regex regHtml = new Regex(@"正则想取的内容RegexOptions.IgnoreCase | RegexOptions.Compiled);
                        string html = reader.ReadToEnd();
                        MatchCollection col = regHtml.Matches(html);

                        return col.Count > 0 ? col[0].ToString().Split('=')[1] : String.Empty;
                    }
                }
            }
            catch (Exception)
            {
                return String.Empty;
            }
        }

相关文章:

  • 2022-02-09
  • 2021-08-08
  • 2022-12-23
  • 2021-12-23
猜你喜欢
  • 2022-02-01
  • 2021-09-20
  • 2022-12-23
  • 2022-12-23
  • 2021-06-13
  • 2022-02-05
  • 2022-02-07
相关资源
相似解决方案