您目前尚未登陆,请选择【登陆】或【注册
首页->其他源码->Asp.Net许愿墙系统源码>>index.aspx.cs>>代码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,不能展示项目的全部,如果想更进一步了解该代码请下载:Asp.Net许愿墙系统源码


当前文件路径:XuYuanQiang/index.aspx.cs 文件类型
普通视图
		            
1using System; 2using System.Collections; 3using System.ComponentModel; 4using System.Data; 5using System.Data.OleDb; 6using System.Drawing; 7using System.Web; 8using System.Web.SessionState; 9using System.Web.UI; 10using System.Web.UI.WebControls; 11using System.Web.UI.HtmlControls; 12using System.Text; 13namespace pizi 14{ 15 /// <summary> 16 /// Summary description for Index. 17 /// </summary> 18 public partial class Index : System.Web.UI.Page 19 { 20 protected System.Web.UI.WebControls.Label Label1; 21 protected Random ran =null; 22 protected Random ranleft=new Random(); 23 protected StringBuilder sb =null; 24 public string str=null; 25 public string stru =null; 26 27 protected void Page_Load(object sender, System.EventArgs e) 28 { 29 30 DataBinder(); 31 32 } 33 public void DataBinder() 34 { 35 36 string Constr ="Provider=Microsoft.Jet.OLeDb.4.0;Data source=" + Server.MapPath("Love_Dai.mdb"); 37 string Querystring ="Select top 1000 cid,cdate,cauthor,ccontent,cbcolor,cfcolor from ccc_love order by cID DESC"; 38 OleDbConnection oleconnection = new OleDbConnection(Constr); 39 //OleDbCommand olecommand = new OleDbCommand(Querystring,oleconnection); 40 //oleconnection.Open(); 41 //olecommand.Connection.Close(); 42 OleDbDataAdapter oleda = new OleDbDataAdapter(Querystring,oleconnection); 43 DataSet ds = new DataSet(); 44 oleda.Fill(ds); 45 oleconnection.Close(); 46 ran = new Random(); 47// string cu =null; 48// for(int i=0;i<ds.Tables[0].Rows.Count;i++) 49// { 50// if(i%10 !=0) 51// { 52// cu += ds.Tables[0].Rows[i]["cauthor"].ToString()+" "; 53// } 54// else 55// { 56// cu +=ds.Tables[0].Rows[i]["cauthor"].ToString()+"<br>"; 57// } 58// } 59// 60// 61// StringBuilder sbu = new StringBuilder(); 62// sbu.Append("<div class='feng' style='position:absolute;left:25px;top:20px;z-index:1;'>"); 63// sbu.Append("感谢所有参与此活动的的朋友!你们的名字将永久停留在2006祝福墙上<br>"); 64// sbu.Append("名字列表如下:<br>"); 65// sbu.Append("<b>"+cu+"</b>"); 66// sbu.Append("</div>"); 67// stru =sbu.ToString(); 68 69 int c= ran.Next(1,ds.Tables[0].Rows.Count); 70 for(int i=0 ;i<ds.Tables[0].Rows.Count;i++) 71 { 72 if(ds.Tables[0].Rows[i]["cauthor"].ToString()!="") 73 { 74 int leftpx = ranleft.Next(10,750); 75 int toppx = ranleft.Next(100,350); 76 sb = new StringBuilder(); 77 sb.Append("<div id=Idai" + ds.Tables[0].Rows[i]["cid"].ToString() +" class='Cccc'"); 78 sb.Append("style='position:absolute;"); 79 sb.Append("left:"+leftpx+"px;"); 80 sb.Append("top:"+ toppx +"px;"); 81 sb.Append("background-color:"+ ds.Tables[0].Rows[i]["cbcolor"].ToString()+";"); 82 sb.Append("z-index:" + ds.Tables[0].Rows[i]["cid"].ToString() +";'"); 83 sb.Append("onmousedown='getFocus(this)'>"); 84 sb.Append("<table border=0>"); 85 sb.Append("<td style='cursor:move;' width='98%'"); 86 sb.Append("onmousedown=MDown(Idai"+ ds.Tables[0].Rows[i]["cid"].ToString() + ")>"); 87 sb.Append("第["+ds.Tables[0].Rows[i]["cid"].ToString()+"]条&nbsp;"); 88 sb.Append( ds.Tables[0].Rows[i]["cdate"].ToString() +"&nbsp;"+"</td><td style='cursor:hand;"); 89 sb.Append("' onclick='ssdel()' width='2%'>√</td></tr>"); 90 sb.Append("<tr><td style='height:100px;padding:5px;' colspan='2'>"); 91 sb.Append(ds.Tables[0].Rows[i]["ccontent"].ToString()); 92 sb.Append("<div style='padding:5px;float:right;'>"+ds.Tables[0].Rows[i]["cauthor"].ToString()+"</div></td></tr></table>"); 93 sb.Append("</div>"); 94 str += sb.ToString(); 95 } 96 } 97 98 99 100 101 } 102 103 Web Form Designer generated code 122 } 123} 124
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:Asp.Net许愿墙系统源码

- Asp.net卖场客户管理系统源码

- ASP.net邮件发送源码(51aspx..

- asp.net2.0将word转换为html..

- 酒店管理系统(三层开发)源码

- 动网论坛DotNet版1.0源码(VS..

- 浩渺留言板源码

- 九九乘法表自动生成示例源码

- RBbbs论坛系统1.01

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