asp.net中怎样将数据库中二进制图片读取出来并做成图片播动效果 急!!!50分
图片播动框架已经出来了就是图片显示不出来protectedvoidPage_Load(objectsender,EventArgse){StringimgUrl1="";...
图片播动框架已经出来了 就是图片显示不出来
protected void Page_Load(object sender, EventArgs e)
{
String imgUrl1 = "";
String imgtext1 = "";
String imgLink1 = "";
String imgUrl2 = "";
String imgtext2 = "";
String imgLink2 = "";
String imgUrl3 = "";
String imgtext3 = "";
String imgLink3 = "";
String imgUrl4 = "";
String imgtext4 = "";
String imgLink4 = "";
String imgUrl5 = "";
String imgtext5 = "";
String imgLink5 = "";
//sql是查找最后5张图片信息
String sql = "Select top 5 NewsImage From news where newsmodel='行业新闻' ORDER BY NewsID DESC";
SqlConnection conn = dataconn.getcon();
conn.Open();
SqlDataAdapter sda = new SqlDataAdapter(sql, conn);
DataSet ds = new DataSet();
sda.Fill(ds);
int i = 1;
foreach (DataRow dr in ds.Tables[0].Rows)
{
String ts = "imgUrl" + i;
ts = dr["NewsImage"].ToString();
i++;
}
conn.Close();
int focus_width = 380;
int focus_height = 184; //184
int text_height = 20;
int swf_height = focus_height + text_height;
String pics = imgUrl1 + "|" + imgUrl2 + "|" + imgUrl3 + "|" + imgUrl4 + "|" + imgUrl5;
String links = imgLink1 + "|" + imgLink2 + "|" + imgLink3 + "|" + imgLink4 + "|" + imgLink5;
String texts = imgtext1 + "|" + imgtext2 + "|" + imgtext3 + "|" + imgtext4 + "|" + imgtext5;
this.showId.InnerHtml = ("<object classid=clsid:d27cdb6e-ae6d-11cf-96b8-444553540000 codebase=http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0 width=" + focus_width + " height=" + swf_height + "><param name=allowScriptAccess value=sameDomain><param name=movie value=http://www.webjx.com/js/focus.swf><param name=quality value=high><param name=bgcolor value=#F0F0F0><param name=menu value=false><param name=wmode value=opaque><param name=FlashVars value='pics=" + pics + "&links=" + links + "&texts=" + texts + "&borderwidth=" + focus_width + "&borderheight=" + focus_height + "&textheight=" + text_height + "'><embed src=pixviewer.swf wmode=opaque FlashVars='pics=" + pics + "&links=" + links + "&texts=" + texts + "&borderwidth=" + focus_width + "&borderheight=" + focus_height + "&textheight=" + text_height + " menu=false bgcolor=#F0F0F0 quality=high width=" + focus_width + " height=" + focus_height + "' allowScriptAccess=sameDomain type=application/x-shockwave-flash pluginspage=http://www.macromedia.com/go/getflashplayer /></object>");
}
能不能具体点 改在哪个地方改 怎么改 展开
protected void Page_Load(object sender, EventArgs e)
{
String imgUrl1 = "";
String imgtext1 = "";
String imgLink1 = "";
String imgUrl2 = "";
String imgtext2 = "";
String imgLink2 = "";
String imgUrl3 = "";
String imgtext3 = "";
String imgLink3 = "";
String imgUrl4 = "";
String imgtext4 = "";
String imgLink4 = "";
String imgUrl5 = "";
String imgtext5 = "";
String imgLink5 = "";
//sql是查找最后5张图片信息
String sql = "Select top 5 NewsImage From news where newsmodel='行业新闻' ORDER BY NewsID DESC";
SqlConnection conn = dataconn.getcon();
conn.Open();
SqlDataAdapter sda = new SqlDataAdapter(sql, conn);
DataSet ds = new DataSet();
sda.Fill(ds);
int i = 1;
foreach (DataRow dr in ds.Tables[0].Rows)
{
String ts = "imgUrl" + i;
ts = dr["NewsImage"].ToString();
i++;
}
conn.Close();
int focus_width = 380;
int focus_height = 184; //184
int text_height = 20;
int swf_height = focus_height + text_height;
String pics = imgUrl1 + "|" + imgUrl2 + "|" + imgUrl3 + "|" + imgUrl4 + "|" + imgUrl5;
String links = imgLink1 + "|" + imgLink2 + "|" + imgLink3 + "|" + imgLink4 + "|" + imgLink5;
String texts = imgtext1 + "|" + imgtext2 + "|" + imgtext3 + "|" + imgtext4 + "|" + imgtext5;
this.showId.InnerHtml = ("<object classid=clsid:d27cdb6e-ae6d-11cf-96b8-444553540000 codebase=http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0 width=" + focus_width + " height=" + swf_height + "><param name=allowScriptAccess value=sameDomain><param name=movie value=http://www.webjx.com/js/focus.swf><param name=quality value=high><param name=bgcolor value=#F0F0F0><param name=menu value=false><param name=wmode value=opaque><param name=FlashVars value='pics=" + pics + "&links=" + links + "&texts=" + texts + "&borderwidth=" + focus_width + "&borderheight=" + focus_height + "&textheight=" + text_height + "'><embed src=pixviewer.swf wmode=opaque FlashVars='pics=" + pics + "&links=" + links + "&texts=" + texts + "&borderwidth=" + focus_width + "&borderheight=" + focus_height + "&textheight=" + text_height + " menu=false bgcolor=#F0F0F0 quality=high width=" + focus_width + " height=" + focus_height + "' allowScriptAccess=sameDomain type=application/x-shockwave-flash pluginspage=http://www.macromedia.com/go/getflashplayer /></object>");
}
能不能具体点 改在哪个地方改 怎么改 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询