日期:2014-05-19  浏览次数:20833 次

帮忙解释哈代码
// '遍历File表单元素,我想知道是不是就是 <input   id= "File1 "   type= "file "     name= "file "/> 所选择的文件路径,如果是我怎么得不到值,我在页面上放了几个 <input   id= "File1 "   type= "file "     name= "file "/> ,但fileList.Count的个数是0,怎么回事,不太懂
                HttpFileCollection   fileList   =   HttpContext.Current.Request.Files;
               

for   (int   i   =   0;   i   <   fileList.Count;   i++)
                {
                        HttpPostedFile   hPostedFile   =   fileList[i];
                        string   fileName   =   Path.GetFileName(hPostedFile.FileName);
                        hPostedFile.SaveAs( "C:\\ "+fileName);
                }
能帮忙解释哈?最好能把概念讲清楚些,我新手
3Q

------解决方案--------------------
在页面中好像不能通过这样的方式循环访问到每一个file控件吧.
记不太清了,好像有这样一个System.web.contrle........