您的位置:首页 > 编程语言 > ASP

ASP.NET上传文件代码

2012-05-24 14:43 357 查看
ASP.NET上传图片代码:

using System;

using System.Data;

using System.Configuration;

using System.Collections;

using System.Web;

using System.Web.Security;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

using System.Web.UI.HtmlControls;

public partial class download : System.Web.UI.Page

{

protected void Page_Load(object sender, EventArgs e)

{

this.Title = "文件下载页面";

}

protected void LinkButton1_Click(object sender, EventArgs e)

{

Response.ContentType = "application/vnd.ms-excel";

Response.ContentEncoding = System.Text.Encoding.GetEncoding("gb2312");

Response.WriteFile(Page.MapPath("file/新生未核查名单.xls"));

}

protected void LinkButton2_Click(object sender, EventArgs e)

{

Response.ContentType = "application/vnd.ms-powerpoit";

Response.ContentEncoding = System.Text.Encoding.GetEncoding("gb2312");

Response.WriteFile(Page.MapPath("file/毕业设计.ppt"));

}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: