您目前尚未登陆,请选择【登陆】或【注册
首页->新闻文章->达达ASP.NET简单新闻发布源码>>Admin/Default.aspx.cs>>代码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,不能展示项目的全部,如果想更进一步了解该代码请下载:达达ASP.NET简单新闻发布源码


当前文件路径:DaDaNews/Admin/Default.aspx.cs 文件类型
普通视图
		            
1using System; 2using System.Collections; 3using System.Configuration; 4using System.Data; 5using System.Data.SqlClient; 6using System.Web; 7using System.Web.Security; 8using System.Web.UI; 9using System.Web.UI.HtmlControls; 10using System.Web.UI.WebControls; 11using System.Web.UI.WebControls.WebParts; 12 13 14public partial class _Default : System.Web.UI.Page 15{ 16 protected void Button1_Click(object sender, EventArgs e) 17 { 18 Db pn163 = new Db(); 19 //密码使用MD5加密 20 string Password = FormsAuthentication.HashPasswordForStoringInConfigFile(Pwd.Text.ToString(), "MD5"); 21 22 SqlConnection Conn = new SqlConnection(pn163.strConn); 23 24 SqlCommand Cmd = new SqlCommand("select * from Admin where UserAdmin='" + Uid.Text + "' and UserPwd = '" + Password + "' ", Conn); 25 26 Conn.Open(); 27 28 SqlDataReader Dr = Cmd.ExecuteReader(); 29 30 if (Uid.Text != "" && Pwd.Text !="") 31 { 32 if (Dr.Read()) 33 { 34 if (Chkcode.Text == Session["Code"].ToString()) 35 { 36 Session["Admin"] = "Admin"; 37 Response.Write("<script>alert('登陆成功!');history.go(-1);</script>"); 38 Response.Redirect("./Main.aspx"); 39 } 40 else 41 { 42 Response.Write("<script>alert('验证码错误!');history.go(-1);</script>"); 43 Chkcode.Focus(); 44 } 45 } 46 else 47 { 48 Response.Write("<script>alert('用户名或密码错误!');history.go(-1);</script>"); 49 } 50 } 51 else 52 { 53 Response.Write("<script>alert('请输入用户名和密码!');history.go(-1);</script>"); 54 } 55 } 56} 57
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:达达ASP.NET简单新闻发布源码

- 文件管理系统源码(Asp.net1.1)

- 简单多功能投票/调查系统源码

- 某公司客户关系管理系统(CRM..

- AjaxControlToolkit之Accord..

- 人才招聘系统(NIIT学生作品)

- Asp.net学生信息管理系统源码

- CD拍卖网51aspx调测版源码

- 苏州某纸业公司网站全站源码

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