在ASP.NET中实现多文件上传
来源:互联网 发布:python开发环境mac 编辑:程序博客网 时间:2024/05/17 05:55
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中实现多文件上传
- 全面优化ASP应用程序的性能(转载)
- ASP.net组件编程中的两种事件编写方法
- ECLIPSE-用ECLIPSE来开发WEB应用
- IT职业男性的5大烦恼(ZT)
- 利用MSXML解析XML文本
- 在ASP.NET中实现多文件上传
- IIS错误代码列表 汇总
- 如何提高IIS 5.0网站伺服器的执行效率呢?
- 大亚DB102-C用户不可错过的美篇——不断流的DB102-C(白色版)
- 给年轻工程师的十大忠告!
- c#中用axWebBrowser中提交表单,或点击某个对象
- 通用WEB SERVICES 检查域名是否被注册
- 大亚DB102-C的ADSL modem的路由功能
- 老鼠爱大米、黄牛爱蛤蟆