温馨提示:代码在线浏览功能只能做为源码浏览参考,不能展示项目的全部,如果想更进一步了解该代码请下载:Asp.net实现网站截图(WebSnap)功能源码
当前文件路径:WebSnap/Snap/Snap.aspx.cs

1using System; 2
using System.Data; 3
using System.Configuration; 4
using System.Collections; 5
using System.Web; 6
using System.Web.Security; 7
using System.Web.UI; 8
using System.Web.UI.WebControls; 9
using System.Web.UI.WebControls.WebParts; 10
using System.Web.UI.HtmlControls; 11
using System.Drawing.Imaging; 12
namespace Snap 13
{ 14
public partial class Snap : System.Web.UI.Page 15
{ 16
protected void Page_Load(object sender, EventArgs e) 17
{ 18
string url = string.Empty; 19
url = Request.QueryString[0]; 20
try 21
{ 22
GetImage thumb = new GetImage(url, 1024, 768, 320, 240); 23
System.Drawing.Bitmap x = thumb.GetBitmap(); 24
x.Save(Response.OutputStream, ImageFormat.Jpeg); 25
Response.ContentType = "image/jpeg"; 26
} 27
catch 28
{ 29
30
} 31
} 32
} 33
} 34





}
}