当前位置: 编程技术>.net/c#/asp.net
不使用qvod播放器获取qvod播放路径的方法
来源: 互联网 发布时间:2014-10-26
本文导语: 代码如下:static string GetHtml(string url) { HttpWebRequest request = WebRequest.Create(url) as HttpWebRequest; request.Timeout = 16 * 1000; HttpWebResponse response = request.GetResponse() as HttpWebResponse; ...
代码如下:
static string GetHtml(string url)
{
HttpWebRequest request = WebRequest.Create(url) as HttpWebRequest;
request.Timeout = 16 * 1000;
HttpWebResponse response = request.GetResponse() as HttpWebResponse;
Stream stream = response.GetResponseStream();
StreamReader reader = new StreamReader(stream, Encoding.Default);
string html = reader.ReadToEnd();
stream.Close();
return html;
}
static string FiltHtml(string htmlStr)
{
var jsurl = Regex.Match(htmlStr, "(?