void Initial()
{
string html = "<!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>" +
"<title></title>" +
"</head>" +
"<body>" +
"<div style=\"border:1px solid red;height:30px; width:800px; margin:auto; margin-top:50px; \">" +
"<img src=\"img/1.jpg\" id=\"imgscroll\" width=\"0px\" height=\"30px\" /></br></br> <div style=\"text-align:center;\" id=\"Msg\"></div>" +
"</div>" +
"</body>" +
"</html>" +
"<script type=\"text/javascript\">" +
"function AddWidth(w,c,n,p) {" +
"document.getElementById(\"imgscroll\").style.width =w;" +
"document.getElementById(\"Msg\").innerHTML ='总共'+'<span style=\"text-align:center;color:red;\">'+c+'</span>'+'条'+',正在发布第'+'<span style=\"text-align:center;color:red;\">'+n+'</span>'+'条'+',已完成'+'<span style=\"text-align:center;color:red;\">'+p+'%'+'</span>'; }" +
"</script>";
Response.Write(html);
Response.Flush();
AddWidth();
}
void AddWidth()
{
int count = 50;
Response.Write("<script type=\"text/javascript\">" +
"AddWidth(0," + count + ",0,0);" + "</script>");
Response.Flush();
for (int i = 1; i <= count; i++)
{
Publish p = new Publish();
string str = p.RemoteSave("http://www.baidu.com", "D:/Publish/ss" + i + ".html");
string AddWidth = "<script type=\"text/javascript\">" +
"AddWidth(" + 800 * i / count + "," + count + "," + i + "," + ((100 * i / count).ToString()) + ");" +
"</script>";
Response.Write(AddWidth);
Response.Flush();
}
Response.End();
}
protected void Button1_Click(object sender, EventArgs e)
{
Initial();
}