我这里只能实现一个,我想知道如何添加新加入按钮的文件信息
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections;
using System.Web.UI.HtmlControls;namespace 文件的上传与管理
{
    public partial class FileUp : System.Web.UI.Page
    {
        CommonClass cc = new CommonClass();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                SaveFUC();
            }        }
        protected void SaveFUC()//保存当前页面上传文件控件集到缓存中
        {
            ArrayList AL = new ArrayList();//创建动态数组
            foreach (Control C in tabFU.Controls)
            {
                if (C.GetType().ToString() == "System.Web.UI.HtmlControls.HtmlTableRow")
                {
                    HtmlTableCell HTC = (HtmlTableCell)C.Controls[0];
                    foreach (Control FUC in HTC.Controls)
                    {  
                        //判断是否为上传控件(Fileuplode)如果是添加到ArrayList中
                        if (FUC.GetType().ToString() == "System.Web.UI.WebControls.FileUpload")
                        {
                            FileUpload FU = (FileUpload)FUC;
                            AL.Add(FU);                        
                        }
                    }
                
                }
            
            }
            //将Arraylist中所有的上传控件添加到缓存中
            Session.Add("FilesControl", AL);        }
        public void GetFUCInfo()
        {
            ArrayList AL = new ArrayList();
            if (Session["FilesControl"] != null)
            { 
              //将缓存中上传控件集放到array中
                AL = (System.Collections.ArrayList)Session["FilesControl"];
                for (int i = 0; i < AL.Count; i++)
                {
                    HtmlTableRow HTR = new HtmlTableRow();
                    HtmlTableCell HTC = new HtmlTableCell();
                    HTC.Controls.Add((System.Web.UI.WebControls.FileUpload)AL[i]);
                    HTR.Controls.Add(HTC);
                    tabFU.Rows.Add(HTR);//将上传控件添加到名为tabFU的表格中
                }
            }
        }
        protected void InsertFUC()
        {
            ArrayList AL = new ArrayList();
            this.tabFU.Rows.Clear();
            //调用GetFUCInfo方法,将放在缓存中的控件添加到表格中
            GetFUCInfo();
            HtmlTableRow HTR = new HtmlTableRow();
            HtmlTableCell HTC = new HtmlTableCell();
            HTC.Controls.Add(new FileUpload());
            HTR.Controls.Add(HTC);
            tabFU.Rows.Add(HTR);
            SaveFUC();        }
        public static int IntlsUF=0;
        protected void UPFile()//执行上传操作,并插入数据表中
        {
            string filePath = fu1.PostedFile.FileName;//获取上传路径
            string fileName = filePath.Substring(filePath.LastIndexOf("\\") + 1);//获取文件名baocun
            string fileSize = Convert.ToString(fu1.PostedFile.ContentLength);//获取文件大小
            string fileExtend = filePath.Substring(filePath.LastIndexOf(".") + 1);//获取扩展名
            string fileType = fu1.PostedFile.ContentType;//获取文件类型
            string serverPath = Server.MapPath("") + fileName;//保存到服务器的路径
            HttpFileCollection HFC = Request.Files;
            for(int i=0;i<HFC.Count;i++)
            {
                    HttpPostedFile UseHPF=HFC[i];//对客户上传的文件单独访问             try
             {
                 if (UseHPF.ContentLength > 0)
                 {
                     //调用GetAuto方法获得文件自动编号
                     int IntFieldID = cc.GetAutoID("fileID", "信息表");
                     //文件真名
                     //实现多个文件上传,不被覆盖
                     string strFileTName = "[" + IntFieldID + "]" + System.IO.Path.GetFileName(UseHPF.FileName);
                     //定义字符串,将上传文件保存到数据库中
                     string sqlStr = "insert into 信息表(fileID,fileName,fileUpDate,fileLoad,fileTrueName)";
                     sqlStr += " values('" + IntFieldID + "'";
                     sqlStr += ",'" + System.IO.Path.GetFileName(UseHPF.FileName) + "'";
                     sqlStr += ",'" + DateTime.Now.ToLongDateString() + "'";
                     sqlStr += ",'" + filePath+ "'";
                     sqlStr += ",'" + strFileTName + "')";
                     int j= cc.Execu(sqlStr);
                     if (j > 0)
                     {
                         //将上传的文件放到指定的文件夹中
                         UseHPF.SaveAs(serverPath);//确定上传文件
                         IntlsUF = 1;
                     }
                                                         }
             }
             catch
             {
                 //上传失败时,清空缓存,从新上传
                 if (Session["FilesControl"]!= null)
                 {                     Session.Remove("FilesControl");
                 }
                 Response.Write(cc.MessageBox("处理出错", "FileUp.aspx"));
                 return;
             
             }
                //当上传成功或者没有上传文件时,清空上传控件集
                if(Session["FilesControl"]!=null)
                {
                    Session.Remove("FilesControl");                }
                if (IntlsUF == 1)
                {
                    Response.Write(cc.MessageBox("处理成功", "FileUp.aspx"));                }
                else
                {
                    Response.Write(cc.MessageBox("请选择上传文件", "FileUp.aspx"));
                }
            }        
        }        protected void bt_addUplode_Click(object sender, EventArgs e)
        {
            InsertFUC();
        }        protected void bt_uplode_Click(object sender, EventArgs e)
        {
       
            UPFile();
        }
    }
}