博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
上传文件
阅读量:7004 次
发布时间:2019-06-27

本文共 853 字,大约阅读时间需要 2 分钟。

protected void btnUpload_Click(object sender, EventArgs e)        {            HttpFileCollection Files = HttpContext.Current.Request.Files;            for (int i = 0; i < Files.Count; i++)            {                HttpPostedFile PostedFile = Files[i];                if (PostedFile.ContentLength > 0)                {                    string FileName = PostedFile.FileName;                    string strExPrentFile = FileName.Substring(FileName.LastIndexOf(".") + 1);                    string sFilePath = "/uploadfile/hotel/" + StringClass.makeFileName24() + i + strExPrentFile;                    PostedFile.SaveAs(Server.MapPath(sFilePath));                }                else                {                    //this.LabMessage.Text = "不能上传空文件";                }            }        }

 

转载于:https://www.cnblogs.com/leebokeyuan/p/6062409.html

你可能感兴趣的文章
为什么我会选择spring cloud,对比以往传统架构他的优点是什么?
查看>>
浅谈Laravel中的设计模式(二) Facade 外观模式
查看>>
Vue 2.0重构G买卖项目经验分享
查看>>
BeautifulSoup使用
查看>>
socket.io 跨域问题,以及netty-socketio如何实现跨域
查看>>
黑科技总结
查看>>
如何编译C#版本的Protocol Buffers与gRPC服务端,客户端代码
查看>>
数据结构
查看>>
vlayout打造淘宝首页多布局展示
查看>>
格式化 U盘/TF卡/SD卡 出错!!“windows无法完成格式化”解决办法。
查看>>
前端基础入门二(CSS)
查看>>
Oracle数据库ORA-01940: 无法删除当前已连接的用户
查看>>
Rsync+sersync多目录同步
查看>>
我的友情链接
查看>>
win7与rhel7共存
查看>>
CentOS添加环境变量
查看>>
SQLSERVER2005的ROW_NUMBER具体使用[转]
查看>>
Error in invoking target install of makefile ins_plsql.mk
查看>>
lftp 命令的使用
查看>>
详解Android系统如何找到最匹配的资源文件的(译)
查看>>