1. 建立一个asp.net页面, 其中包含3个FILEUPLOAD控件与一个按钮控件
2: .CS的代码中的按钮上传事件:
protected void Button1_click(Object sender,Eventargs e)
{
string filepath="C:\\Uploads";保存上传文件的路径
HttpFileConllection uploadfiles=Request.Files;
for(int i=0;i<uploadfiles.count;i++)
{
HttpPostedFiles userPostFile=uploadfiles[i];
try
{
if(userPostFile.ContentLenght>0)
{
userPostFile.saves(filepath+system.IO.path,GetfileName(userPostFile.FileName));
}
}
catch(Exceptin e)
{
new throw e;
}
}
}