在ASP.NET中实现多文件上传
来源:互联网 发布:jordan鞋 知乎 编辑:程序博客网 时间:2024/05/17 06:33
private Boolean SaveFiles()
{
//得到File表单元素
HttpFileCollection files = HttpContext.Current.Request.Files;
try
{
for(int intCount= 0; intCount< files.Count; intCount++)
{
HttpPostedFile postedFile = files[intCount];
string fileName, fileExtension;
//获得文件名字
fileName = System.IO.Path.GetFileName(postedFile.FileName);
if (fileName != "")
{
//获得文件名扩展
fileExtension = System.IO.Path.GetExtension(fileName);
//可根据不同的扩展名字,保存文件到不同的文件夹
//注意:可能要修改你的文件夹的匿名写入权限。
postedFile.SaveAs(System.Web.HttpContext.Current.Request.MapPath("upFiles/") + fileName);
}
}
return true;
}
catch(System.Exception Ex)
{
return false;
}
}
{
//得到File表单元素
HttpFileCollection files = HttpContext.Current.Request.Files;
try
{
for(int intCount= 0; intCount< files.Count; intCount++)
{
HttpPostedFile postedFile = files[intCount];
string fileName, fileExtension;
//获得文件名字
fileName = System.IO.Path.GetFileName(postedFile.FileName);
if (fileName != "")
{
//获得文件名扩展
fileExtension = System.IO.Path.GetExtension(fileName);
//可根据不同的扩展名字,保存文件到不同的文件夹
//注意:可能要修改你的文件夹的匿名写入权限。
postedFile.SaveAs(System.Web.HttpContext.Current.Request.MapPath("upFiles/") + fileName);
}
}
return true;
}
catch(System.Exception Ex)
{
return false;
}
}
- 在ASP.NET中实现多文件上传
- 在ASP.NET中实现多文件上传
- 在ASP.NET中实现多文件上传
- 在ASP.NET中实现多文件上传(C#)
- 在ASP.NET中实现多文件上传
- 在ASP.NET中实现多文件上传
- 在ASP.NET中实现多文件上传
- 在ASP.NET中实现多文件上传
- 在ASP.NET中实现多文件上传
- 在ASP.NET中实现多文件上传
- 在ASP.NET中实现多文件上传
- 在ASP.NET中实现多文件上传
- 在ASP.NET中实现多文件上传
- 在ASP.NET中实现多文件上传
- 在ASP.NET中实现多文件上传-孟宪会
- 在ASP.NET中实现多文件上传
- 在ASP.NET中实现多文件上传
- 在ASP.NET中实现多文件上传
- a table can be shown in a labelControl
- 成功的部门经理--一周速成【原创】
- ADSL(WANA)数据配置步骤
- 8220V1.X版本WANE上行配置步骤
- ASP.NET实现上传文件到服务器
- 在ASP.NET中实现多文件上传
- 8220V2.X版本开局步骤
- Cache缓存模块设计要素
- C#中调用API
- 网络管理十一杀招
- Jetspeed介绍
- jetspeed开发实战
- 动态加载用户控件的组件!
- 如何高效维护局域网(优化篇)