<%&#64; Page Language&#61;"C#" AutoEventWireup&#61;"true" CodeFile&#61;"Default3.aspx.cs" Inherits&#61;"Default3" %>
DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns&#61;"http://www.w3.org/1999/xhtml">
<head runat&#61;"server">
<title>title>
head>
<body>
<form id&#61;"form1" runat&#61;"server">
<div>
链接地址&#xff1a;<asp:TextBox ID&#61;"TextBox1" runat&#61;"server" Height&#61;"32px"
Width&#61;"438px">asp:TextBox><br />
页面标题&#xff1a;<asp:TextBox ID&#61;"TextBox3" runat&#61;"server" Height&#61;"32px"
Width&#61;"438px">asp:TextBox><br />
视频代码&#xff1a;<asp:TextBox ID&#61;"TextBox2" runat&#61;"server" TextMode&#61;"MultiLine"
Height&#61;"173px" Width&#61;"439px">asp:TextBox><br />
<asp:Button ID&#61;"Button1" runat&#61;"server" Text&#61;"Button" onclick&#61;"Button1_Click" /><br />
耗时&#xff1a;<asp:Label ID&#61;"Label1" runat&#61;"server" Text&#61;"Label">asp:Label>
div>
<div id&#61;"div" runat&#61;"server">div>
form>
body>
html>
DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns&#61;"http://www.w3.org/1999/xhtml">
<head runat&#61;"server">
<title>title>
head>
<body>
<form id&#61;"form1" runat&#61;"server">
<div>
链接地址&#xff1a;<asp:TextBox ID&#61;"TextBox1" runat&#61;"server" Height&#61;"32px"
Width&#61;"438px">asp:TextBox><br />
页面标题&#xff1a;<asp:TextBox ID&#61;"TextBox3" runat&#61;"server" Height&#61;"32px"
Width&#61;"438px">asp:TextBox><br />
视频代码&#xff1a;<asp:TextBox ID&#61;"TextBox2" runat&#61;"server" TextMode&#61;"MultiLine"
Height&#61;"173px" Width&#61;"439px">asp:TextBox><br />
<asp:Button ID&#61;"Button1" runat&#61;"server" Text&#61;"Button" onclick&#61;"Button1_Click" /><br />
耗时&#xff1a;<asp:Label ID&#61;"Label1" runat&#61;"server" Text&#61;"Label">asp:Label>
div>
<div id&#61;"div" runat&#61;"server">div>
form>
body>
html>
C#代码using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Net;
using HtmlAgilityPack;
public partial class Default3 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
var time1 &#61; DateTime.Now;
WebRequest request1 &#61; WebRequest.Create(TextBox1.Text);
var str &#61; request1.GetResponse().GetResponseStream();
var doc &#61; new HtmlAgilityPack.HtmlDocument();
doc.Load(str,true);
var nodes &#61; doc.DocumentNode.SelectSingleNode("//title");
TextBox3.Text &#61; nodes.InnerText;
var flv &#61; doc.GetElementbyId("link3");
TextBox2.Text &#61; flv.Attributes["value"].Value;
div.InnerHtml &#61; TextBox2.Text;
Label1.Text &#61; (DateTime.Now - time1).TotalMilliseconds.ToString();
}
}
using System.Text;
using System.Web;
using System.Web.UI;
using System.Net;
using HtmlAgilityPack;
public partial class Default3 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
var time1 &#61; DateTime.Now;
WebRequest request1 &#61; WebRequest.Create(TextBox1.Text);
var str &#61; request1.GetResponse().GetResponseStream();
var doc &#61; new HtmlAgilityPack.HtmlDocument();
doc.Load(str,true);
var nodes &#61; doc.DocumentNode.SelectSingleNode("//title");
TextBox3.Text &#61; nodes.InnerText;
var flv &#61; doc.GetElementbyId("link3");
TextBox2.Text &#61; flv.Attributes["value"].Value;
div.InnerHtml &#61; TextBox2.Text;
Label1.Text &#61; (DateTime.Now - time1).TotalMilliseconds.ToString();
}
}