您目前尚未登陆,请选择【登陆】或【注册
首页->其他源码->BugNet0.7.881.0汉化免安装版源码>>BugNET_WAP/Bugs/ViewAttachment.aspx.cs>>代码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,不能展示项目的全部,如果想更进一步了解该代码请下载:BugNet0.7.881.0汉化免安装版源码


当前文件路径:BugNet/BugNET_WAP/Bugs/ViewAttachment.aspx.cs 文件类型
普通视图
		            
1using System; 2using System.Collections; 3using System.ComponentModel; 4using System.Data; 5using System.IO; 6using System.Text; 7using System.Drawing; 8using System.Web; 9using System.Web.SessionState; 10using System.Web.UI; 11using System.Web.UI.WebControls; 12using System.Web.UI.HtmlControls; 13using System.Configuration; 14using BugNET.BusinessLogicLayer; 15 16namespace BugNET 17{ 18 /// <summary> 19 /// Summary description for ViewAttachment. 20 /// </summary> 21 public partial class ViewAttachment : System.Web.UI.Page 22 { 23 protected int BugAttachmentID; 24 25 /// <summary> 26 /// Handles the Load event of the Page control. 27 /// </summary> 28 /// <param name="sender">The source of the event.</param> 29 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> 30 protected void Page_Load(object sender, System.EventArgs e) 31 { 32 33 BugAttachmentID = Convert.ToInt32(Request.Params["aid"]); 34 35 if (BugAttachmentID != 0) 36 { 37 38 Attachment att = Attachment.GetAttachmentById(BugAttachmentID); 39 Bug b = Bug.GetBugById(att.BugId); 40 Project p = Project.GetProjectById(b.ProjectId); 41 42 string FileName = att.FileName; 43 string ProjectPath = p.UploadPath; 44 string Path; 45 46 //append a trailing slash if it doesn't exist 47 if(!ProjectPath.EndsWith("\\")) 48 ProjectPath = String.Concat(ProjectPath,"\\"); 49 50 Path = String.Concat("~\\Uploads\\", ProjectPath, FileName); 51 52 if (System.IO.File.Exists(Server.MapPath(Path))) 53 { 54 Response.Clear(); 55 Response.ContentType = att.ContentType; 56 Response.AddHeader("Content-Disposition", "attachment; filename=" + FileName); 57 Response.WriteFile(Path); 58 } 59 else 60 { 61 Response.Write("<h1>Attachment Not Found.</h1> It may have been deleted from the server."); 62 } 63 } 64 65 } 66 67 Web Form Designer generated code 89 } 90} 91
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:BugNet0.7.881.0汉化免安装版源码

- NHibernate三层简单用户管理系统

- Asp.net房产采集系统Ajax版源码

- GridView实用示例源码附加导..

- 鹿茸文章管理系统(Access版)..

- 51aspx实用聊天室源码(利用A..

- 书爸爸电子书连载网源码

- MyShop网络商城源码(mvc开发)

- 星幻短信群发平台Web源码

51Aspx.com 版权所有 CopyRight © 2000-2008. 京ICP备06046876号