文件上传
来源:互联网 发布:日本人的交友软件 编辑:程序博客网 时间:2024/06/05 10:44
public void Fileurl(string name,string pa) { //获取上传文件名字 string dn = this.DropDownList1.Text.Trim()+".doc"; if (!Directory.Exists(pa)) { //创建文件夹pa DirectoryInfo folder = Directory.CreateDirectory(pa); } else { string SNo = Session["name"].ToString(); string DNo; string DN = this.DropDownList1.Text.Trim(); switch (DN) { case "任务书": DNo = "1"; break; case "一稿": DNo = "2"; break; case "二稿": DNo = "3"; break; case "三稿": DNo = "4"; break; case "定稿": DNo = "5"; break; default: DNo = "6"; break; } Tool tool = new Tool(); SqlConnection mycon = tool.Getconn(); mycon.Open(); string sql = "delete from StudebtData where SNo = '"+SNo+"' and DNo = '"+DNo+"'"; SqlCommand mycmd = new SqlCommand(sql, mycon); mycmd.ExecuteNonQuery(); mycon.Close(); mycon.Open(); string path = "~/Files/"+SNo+"/"+DN+".html"; string pat = Server.MapPath(path); if (File.Exists(pat)) { FileInfo file = new FileInfo(pat); file.Delete(); } // Response.Write("<script>alert('文件上传成功');location='TiJ.aspx'</script>"); } //保存文件 FileUpload1.SaveAs(pa + "//" + dn); }
0 0
- 文件上传---文件上传
- 上传文件
- 文件上传
- 上传文件
- 文件上传
- 文件上传
- 上传文件
- 上传文件
- 文件上传
- 文件上传
- 文件上传
- 文件上传
- 文件上传
- 文件上传
- 文件上传
- 上传文件
- 文件上传
- 文件上传
- linux0.11 块设备驱动与高速缓冲区
- lazarus:一个函数修改目录名(文件夹名)
- 十一、机器学习系统设计笔记之对分类
- 从VCC,GND想到EMC
- PowerShell 异常处理(trap / try…catch / Throw / $Error / $ConfirmPreference)
- 文件上传
- C++ 用libcurl库进行http通讯网络编程
- Android中NavigationDrawer的分析
- 学习爬虫的记录
- android--(BroadcastReceiver)
- 十二、机器学习系统设计笔记之大数据
- 欢迎使用CSDN-markdown编辑器
- 批处理文件 bat 的入门命令
- LintCode:二叉树的最小深度