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


当前文件路径:XuYuanQiang/admin.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.Security; 10using System.Web.UI; 11using System.Web.UI.WebControls; 12using System.Web.UI.HtmlControls; 13 14namespace pizi 15{ 16 /// <summary> 17 /// Summary description for Test. 18 /// </summary> 19 public partial class Test : System.Web.UI.Page 20 { 21 protected string md5s = null; 22 23 protected void Page_Load(object sender, System.EventArgs e) 24 { 25 if(Session["user"]==null) 26 { 27 Response.Write("您没有权限 所以你不能登陆!"); 28 Server.Transfer("index.aspx"); 29 } 30 if(Session["link"]!=null) 31 { 32 msgbox.Text = Session["link"].ToString(); 33 } 34 this.DataBinder(); 35 36 37 } 38 39 Web Form Designer generated code 58 59 public void DataBinder() 60 { 61 string Constr ="Provider=Microsoft.Jet.OLeDb.4.0;Data source=" + Server.MapPath("Love_Dai.mdb"); 62 string Querystring ="Select cdate,cauthor,md5id,sendname from ccc_love order by cdate "; 63 OleDbConnection oleconnection = new OleDbConnection(Constr); 64 //OleDbCommand olecommand = new OleDbCommand(Querystring,oleconnection); 65 //oleconnection.Open(); 66 //olecommand.Connection.Close(); 67 OleDbDataAdapter oleda = new OleDbDataAdapter(Querystring,oleconnection); 68 DataSet ds = new DataSet(); 69 oleda.Fill(ds); 70 oleconnection.Close(); 71 DataGrid1.DataSource = ds.Tables[0].DefaultView; 72 DataGrid1.DataBind(); 73 } 74 75 protected void Button1_Click(object sender, System.EventArgs e) 76 { 77 if(Name.Text.Length !=0 && Name.Text !=null ) 78 { 79 md5s = FormsAuthentication.HashPasswordForStoringInConfigFile(Name.Text,"md5"); 80 string Constr ="Provider=Microsoft.Jet.OLeDb.4.0;Data source=" + Server.MapPath("Love_Dai.mdb"); 81 string Querystring ="Insert Into ccc_love(md5id,sendname) values ( @md5id,@sendname)"; 82 OleDbConnection oleconnection = new OleDbConnection(Constr); 83 OleDbCommand cmd = new OleDbCommand(Querystring,oleconnection); 84 cmd.Parameters.Add("@md5id",OleDbType.VarChar,250); 85 cmd.Parameters.Add("@sendname",OleDbType.VarChar,250); 86 cmd.Parameters["@md5id"].Value = md5s ; 87 cmd.Parameters["@sendname"].Value =Name.Text; 88 try 89 { 90 oleconnection.Open(); 91 cmd.ExecuteNonQuery(); 92 93 } 94 catch(Exception ex) 95 { 96 msgbox.Text = "错误是:" + ex.ToString(); 97 } 98 finally 99 { 100 oleconnection.Close(); 101 cmd.Dispose(); 102 } 103 msgbox.Text = "根据'"+ Name.Text +"'已经建立了一个激活连接:" + "http://您的地址/BlessPost.aspx?Upsotname=" +md5s; 104 Session["link"] = msgbox.Text; 105 } 106 else 107 { 108 msgbox.Text = "忘记输入了!"; 109 } 110 Response.Redirect("admin.aspx"); 111 112 } 113 } 114} 115
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:Asp.Net许愿墙系统源码

- 天天水果店源码

- ASP.NET通用权限管理系统1.0..

- 在线订餐系统源码

- VS2005典型实例源码大全(C#)

- AspNetPager分页控件6.0源码

- asp.net验证控件气泡提示控件..

- 吾创网留言板V1.1源码

- ASP.NET 2.53 缩略图水印组件..

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