资源简介
简单的题库管理系统在、可实现对试卷的增删改查界面很漂亮!

代码片段和文件信息
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Web.Security;
//该源码下载自www.51aspx.com(51aspx.com)
namespace examonline
{
///
/// adminpwd 的摘要说明。
///
public partial class adminpwd : System.Web.UI.Page
{
protected void Page_Load(object sender System.EventArgs e)
{
if((bool)Session[“IsLogined“]==false)
{
Response.Redirect(“index.aspx“);
}
lblmsg.Text=(string)Session[“info“];
Session[“info“]=““;
}
#region Web 窗体设计器生成的代码
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}
///
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
///
private void InitializeComponent()
{
}
#endregion
protected void btnlogin_Click(object sender System.EventArgs e)
{
string oldpwd = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(txtOldpwd.Text “MD5“);
string newpwd = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(txtNewpwd.Text “MD5“);
string repwd = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(txtRepwd.Text “MD5“);
if(newpwd!=repwd)
{
Session[“info“]=“密码确认有误!“;
Response.Redirect(“adminpwd.aspx“);
Response.End();
}
string sql = “update [admin] set password=‘“+newpwd+“‘ where username=‘“ + txtid.Text.Trim() + “‘ and password=‘“ + oldpwd + “‘“;
SqlConnection cn = new SqlConnection(“server=(local);uid=sa;pwd=123456;database=examonline“);
SqlCommand cmd = new SqlCommand(sql cn);
try
{
cn.Open();
int h = cmd.ExecuteNonQuery();
if(h>0)
{
lblmsg.Text=“修改成功!“;
}
else
{
Session[“info“] = “用户名或密码错误!“;
Response.Redirect(“adminpwd.aspx“);
Response.End();
}
}
catch(SqlException ex)
{
Session[“info“] = “数据库错误:“ + ex.Message.ToString();
Response.Redirect(“adminpwd.aspx“);
Response.End();
}
finally
{
cn.Close();
}
}
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2011-04-13 16:14 simpleExam\
目录 0 2007-10-31 15:41 simpleExam\App_Code\
文件 2115 2007-10-21 17:22 simpleExam\App_Code\AssemblyInfo.cs
文件 1556 2007-10-21 17:22 simpleExam\App_Code\Global.asax.cs
目录 0 2007-10-31 15:41 simpleExam\DB_51aspx\
文件 2031616 2011-04-13 16:13 simpleExam\DB_51aspx\examonline_Data.MDF
文件 3932160 2011-04-13 16:13 simpleExam\DB_51aspx\examonline_Log.LDF
文件 528 2007-11-06 09:21 simpleExam\Default.aspx
文件 409 2007-10-21 17:26 simpleExam\Default.aspx.cs
文件 63 2007-10-21 17:22 simpleExam\Global.asax
文件 1733 2002-01-29 22:04 simpleExam\Global.asax.resx
文件 4232 2007-11-06 09:01 simpleExam\Web.config
文件 5050 2007-10-21 17:22 simpleExam\adminpwd.aspx
文件 2468 2011-04-13 15:44 simpleExam\adminpwd.aspx.cs
文件 5317 2007-04-16 03:39 simpleExam\adminpwd.aspx.resx
目录 0 2011-04-13 16:14 simpleExam\bin\
文件 410 2002-12-30 01:40 simpleExam\chinaz.com.txt
文件 6927 2007-10-21 17:22 simpleExam\createexam.aspx
文件 7341 2011-04-13 16:05 simpleExam\createexam.aspx.cs
文件 5317 2007-04-18 20:43 simpleExam\createexam.aspx.resx
文件 1717 2007-10-21 17:22 simpleExam\examonline.sln
文件 4495 2007-11-06 09:22 simpleExam\help.aspx
文件 964 2007-10-21 17:22 simpleExam\help.aspx.cs
文件 5317 2007-04-16 23:54 simpleExam\help.aspx.resx
目录 0 2011-04-13 16:09 simpleExam\images\
文件 34975 2007-04-15 10:45 simpleExam\images\054.SWF
文件 50176 2011-04-13 16:09 simpleExam\images\Thumbs.db
文件 356 2003-03-18 15:37 simpleExam\images\bg1222.jpg
文件 354 2003-03-18 15:37 simpleExam\images\bg1223.jpg
文件 152 2003-03-19 20:50 simpleExam\images\copyright.gif
文件 220 2003-03-19 20:50 simpleExam\images\footer.gif
............此处省略18个文件信息
相关资源
- C# 软件版本更新
- C#屏幕软键盘源码,可以自己定制界面
- 020ASP.NET车辆综合管理系统.zip
- 智慧城市 智能家居 C# 源代码
- c#获取mobile手机的IMEI和IMSI
- C#实现简单QQ聊天程序
- 操作系统 模拟的 欢迎下载 C#版
- C#写的计算机性能监控程序
- 用C#实现邮件发送,有点类似于outlo
- MVC model层代码生成器 C#
- c#小型图书销售系统
- C# Socket Server Client 通讯应用 完整的服
- c# winform 自动登录 百度账户 源代码
- C#编写的16进制计算器
- C#TCP通信协议
- C# 数据表(Dataset)操作 合并 查询一
- C#语音识别系统speechsdk51,SpeechSDK51L
- 数据库备份还原工具1.0 C# 源码
-
[免费]xm
lDocument 节点遍历C# - EQ2008LEDc#开发实例
- DirectX.Capturec# winform 操作摄像头录像附
- c# 实现的最大最小距离方法对鸢尾花
- C#版保龄球记分代码
- C#自定义控件
- 基于c#的实验室设备管理系统621530
- C# 使用ListView控件实现图片浏览器(源
- C#简单窗体聊天程序
- C#指纹识别系统程序 报告
- c# 高校档案信息管理系统
- c#向word文件插入图片
评论
共有 条评论