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;
}
}