frm_Search.getSql.value = gettxt;
frm_Search.action = fileName;
frm_Search.submit ();
信息登陆修改模块:
管理用户录入投票所需要的内容,包含问题选项、学生信息、教师信息、部门、发布日期等,同时从登录模块得到用户名,这些信息将被写入数据库中保存。该模块还负责编辑状态下的更新,这时,它将根据取得的Title字段值对页面控件初始化。主要代码://IsRegUserOk函数:判断用户是否已经注册和密码是否正确public bool IsRegUserOk(){ string name=TextBoxName.Text.Trim();string pwd=TextBoxPassword.Text.Trim();//建立/打开数据库连接SqlConnection conn=new SqlConnection();conn.ConnectionString="server=(local);uid=sa;pwd=;database=jxdb";conn.Open();//建立sql字符串string sql="select * from reg where name='"+name+"'";SqlDataReader dr;SqlCommand cmd=new SqlCommand(sql,conn);dr=cmd.ExecuteReader(); //保留用户注册与否信息bool isRegUserExist=dr.Read();//关闭DataReaderdr.Close();//取得用户名的密码string sqlBoth="select * from reg where name='"+name+"'";sqlBoth+="and pwd='"+pwd+"'";SqlCommand cmdBoth=new SqlCommand(sqlBoth,conn);SqlDataReader drBoth;drBoth=cmdBoth.ExecuteReader();//保留用户名+密码同时存在信息bool isBothExist=drBoth.Read();//关闭DataReaderdrBoth.Close();conn.Close();//判断用户是否注册if(!isRegUserExist){Response.Write("<script>alert('此用户尚未注册!')");return false;}//判断用户名与密码是否一致else if(!isBothExist){Response.Write("<script>alert('用户名和密码不一致,不能进入!')"); return false;}elsereturn true;}
留言模块:
学生成功登陆后可以点击教师的姓名,然后出来一个留言的选项,如果学生希望用文字的形式给教师提供意见的话,可以写下来,然后提交,如果提交成功的话,留言则已经形成,教师如果登陆的话将会显示有最新留言需要阅读。留言不是每个学生必须的选项,只是除了选项之外,给老师和学生提供更具有自由度交流的平台,所以同样教师可以根据留言进行自我测评,给学生以反馈信息。
关键代码如下:
If ErrCodes="" Then
Dim dv_ubb,abgcolor
Set dv_ubb=new Message_UbbCode
SELECT Case Request("action")
Case "new"
Response.Cookies("Message")=""
IF id<>"" Then
title="RW: "
SqlStr="SELECT id,title,content,incept,sender,sendtime FROM Dv_Message WHERE incept='"&Message.MemberName&"' And id="&Message.checkStr(id)
temptxt=template.Strings(56)
End If
Message.Stats=ActInfo(0) '"发送短信"
call sendmsg()
······
Message.Stats=ActInfo(3) '"转发短信"
SqlStr="SELECT id,title,content,incept,sender,sendtime FROM Dv_Message WHERE (incept='"&Message.MemberName&"' or sender='"&Message.MemberName&"') And id="&Message.checkStr(id)
temptxt=template.Strings(57)
call sendmsg()
Case "edit"
Response.Cookies("Message")=""
Message.Stats=ActInfo(4) '"修改短信"
SqlStr="SELECT id,title,content,incept,sender,sendtime FROM Dv_Message WHERE sender='"&Message.MemberName&"' And issend=0 And id="&Message.checkStr(id)
call sendmsg()
Case "savedit"
Call savedit()
······
Case ActInfo(12) '"清空垃圾箱"
Message.Stats=ActInfo(12)
Call AllDelrecycle()
Case Else
ErrCodes=ErrCodes+"<