int intTotal = Request.Files.Count;
if (intTotal > 0) {
for (int i = 0; i < intTotal ; i++)
{
HttpPostedFile file = Request.Files[i];
if (file.ContentLength > 0 || !string.IsNullOrEmpty(file.FileName))
{
string[] strarr = file.FileName.Split('\\');
string filename = strarr[strarr.GetLength(0) – 1];
//保存文件
file.SaveAs(System.Web.HttpContext.Current.Server.MapPath("./file/" + filename));
Response.Write(i+1+"."+filename+"<br />");
}
}
}else{
Response.Write("得选个文件吧?");
}