62,073
社区成员
发帖
与我相关
我的任务
分享
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;
using BSMS.Models;
using BSMS.BLL;
public partial class ProjectMessage_GetImage : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
this.ShowImage();
}
ProImage proimage = new ProImage();
ProImageManage proimagemng = new ProImageManage();
private void ShowImage()
{
try
{
//context.Response.ContentType = "text/plain";
//context.Response.Write("Hello World");
string imagestr = Request.QueryString["ImID"].ToString();
int imageid = Convert.ToInt16(imagestr);
proimage = proimagemng.GetImageByID(imageid);
Response.ContentType = "application/octet-stream";
Response.BinaryWrite(proimage.ImageData);
}
catch (Exception ex)
{
//JScript.Alert(UpdatePanel1, ex.Message, this.Page);
JScript.Alert(ex.Message, this.Page);
}
finally
{ }
}
}