当然,你可以解决网际快车或迅雷的批量下载功能,不的本文讨论之列。
这里利用了 WebClient的DownloadFile办法由于源代码比较简单我就不多说
// BatchDownload.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="BatchDownload.aspx.cs" Inherits="_Default" Debug="true" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>批量图片下载网页</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</div>
</form>
</body>
</html>
// BatchDownload.asp.cs
using System;
using System.Data;
using System.Drawing;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.IO;
using System.Net;
using System.Text;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender EventArgs e)
{
StringBuilder sb = new StringBuilder();
int m = 0;
for (int i = 1; i < 200; i++)
{
for (int j = 1; j < 100; j++)
{
string folder;
if(i < 100)
&nbs |