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


当前文件路径:XuYuanQiang/Input.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; 13 14namespace pizi 15{ 16 /// <summary> 17 /// Summary description for Input. 18 /// </summary> 19 public partial class Input : System.Web.UI.Page 20 { 21 protected Encoding encod = null; 22 23 protected void Page_Load(object sender, System.EventArgs e) 24 { 25 26 this.B(); 27 28 } 29 public void B() 30 { 31 if(Request["author"] ==null || Request["tagbcolor"]==null || Request["massages"]==null) 32 { 33 Response.End(); 34 } 35 encod = Encoding.GetEncoding("GB2312"); 36 string cauthor = Request["author"].ToString(); 37 string cbcolor = Request["tagbcolor"].ToString(); 38 string ccontent = Request["massages"].ToString(); 39 string md5id = Session["md5id"].ToString(); 40 41 if(ccontent.Length>100) 42 { 43 ccontent = ccontent.Substring(0,100); 44 } 45 string Constr ="Provider=Microsoft.Jet.OLeDb.4.0;Data source=" + Server.MapPath("Love_Dai.mdb"); 46 //string Querystring ="Insert Into ccc_love(cauthor,ccontent,cbcolor) values ( @cauthor,@ccontent,@cbcolor)"; 47 string Querystring =" Update ccc_love set cauthor=@cauthor,ccontent=@ccontent,cbcolor=@cbcolor where md5id=@md5id "; 48 OleDbConnection oleconnection = new OleDbConnection(Constr); 49 OleDbCommand cmd = new OleDbCommand(Querystring,oleconnection); 50 cmd.Parameters.Add("@cauthor",OleDbType.VarChar,250); 51 cmd.Parameters.Add("@ccontent",OleDbType.VarChar,250); 52 cmd.Parameters.Add("@cbcolor",OleDbType.VarChar,50); 53 cmd.Parameters.Add("@md5id",OleDbType.VarChar,250); 54 cmd.Parameters["@cauthor"].Value = cauthor; 55 cmd.Parameters["@ccontent"].Value = ccontent; 56 cmd.Parameters["@cbcolor"].Value = cbcolor; 57 cmd.Parameters["@md5id"].Value = md5id; 58 59 try 60 { 61 oleconnection.Open(); 62 cmd.ExecuteNonQuery(); 63 oleconnection.Close(); 64 cmd.Dispose(); 65 } 66 catch(Exception e) 67 { 68 msgbox.Text = "错误是:" + e.ToString(); 69 } 70 71 72 //Response.Write("<script>alert('\n\n\n\n粘贴祝福纸条成功!!!\n\n\n返回首页查看祝福\n\n\n');location.href='index.aspx';;</script>"); 73 Response.Redirect("index.aspx"); 74 75 } 76 77 Web Form Designer generated code 96 } 97} 98
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:Asp.Net许愿墙系统源码

- 内文广告管理系统V1.1版源码

- 山建大校内购物网V1.1源码

- 简单绿色游戏网站(含报名表)

- 简单的XML学生信息系统(注释..

- MagicAjax入门程序之无刷新显..

- XML同学录系统源码(毕业设计)

- AspxCn无刷新整合型网站开源..

- XproerBBS1.1(Access数据库)..

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