資源簡介
代碼片段和文件信息
using?System;
using?System.Data;
using?System.Configuration;
using?System.Web;
using?System.Web.Security;
using?System.Web.UI;
using?System.Web.UI.WebControls;
using?System.Web.UI.WebControls.WebParts;
using?System.Web.UI.HtmlControls;
using?System.Collections;
using?System.Data.SqlClient;
public?partial?class?_Default?:?System.Web.UI.Page?
{
????protected?void?Page_Load(object?sender?EventArgs?e)
????{
????????if?(!IsPostBack)
????????{
????????????ArrayList?iden?=?new?ArrayList();
????????????iden.Add(“學生“);
????????????iden.Add(“教師“);
????????????iden.Add(“管理員“);
????????????mydropdownlist.DataSource?=?iden;
????????????mydropdownlist.DataBind();
????????}?????
????????
????}
????protected?void?login_Click(object?sender?ImageClickEventArgs?e)
????{
????????int?a?=?mydropdownlist.SelectedIndex;
????????string?mycomm_txt;
????????SqlConnection?myconn?=?new?SqlConnection(ConfigurationSettings.AppSettings[“connection“]);
????????if?(a?==?0)?mycomm_txt?=?“select?count(*)?from?User_stu?where?Stu_id=‘“?+?user_id.Text?+?“‘?and?password=‘“?+?password.Text?+?“‘“;
????????else?if?(a?==?1)?mycomm_txt?=?“select?count(*)?from?User_tea?where?Tea_id=‘“?+?user_id.Text?+?“‘?and?password=‘“?+?password.Text?+?“‘“;
????????else?mycomm_txt?=?“select?count(*)?from?User_admin?where?Admin_id=‘“?+?user_id.Text?+?“‘?and?password=‘“?+?password.Text?+?“‘“;
????????//default:?mycomm_txt?=?“select?count(*)?from?User_stu?where?Stu_id=‘“?+?user_id.Text?+?“‘?and?password=‘“?+?password.Text?+?“‘“;?
????????SqlCommand?mycomm?=?new?SqlCommand(mycomm_txt?myconn);
????????myconn.Open();
????????object?obj?=?mycomm.ExecuteScalar();
????????if?(obj?!=?null?&&?obj.ToString()?!=?“0“)
????????{
????????????//FormsAuthentication.SetAuthCookie(user_id?false);
????????????if?(a?==?0)
????????????{
????????????????String?id?=?“student.aspx?id=“?+?user_id.Text;
????????????????Response.Redirect(id);?
????????????????Response.Redirect(“student.aspx“);
????????????}
????????????else?if?(a?==?1)
????????????{
????????????????Session[“tea_id“]?=?user_id.Text;
???????????????//?String?id?=?“student.aspx?id=“?+?user_id.Text;
???????????????//?Response.Redirect(id);
????????????????Response.Redirect(“teacher.aspx“);
????????????}
????????????else?Response.Redirect(“main.aspx“);
????????}
????????else
????????{
????????????Response.Write(“ript?language=‘javascript‘>alert(‘登錄失敗!‘); ript>“);
????????}
????????myconn.Close();
????}
????protected?void?cancel_Click(object?sender?ImageClickEventArgs?e)
????{
????????user_id.Text?=?““;
????????password.Text?=?““;
????}
???
????protected?void?get_password_Click(object?sender?EventArgs?e)
????{
????????Response.Write(“ript?language=‘javascript‘?defer>ret?=?window.showModalDialog(‘stu_get_password.aspx?Action=add‘window‘dialogHeight:150px;dialogWidth:230px;center:Yes;Help:No;Resizable:No;Scroll:auto;Status:no;‘); ript>“);
????}
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
????..A.SH.?????????9??2012-12-29?10:26??程序\App_Code\Desktop_.ini
????..A.SH.?????????9??2012-12-29?14:09??程序\App_Data\Desktop_.ini
?????文件????????953??2012-12-29?13:27??程序\common\body.aspx
?????文件????????412??2012-12-29?11:53??程序\common\body.aspx.cs
?????文件??????27382??2012-12-29?14:46??程序\common\cal.htm
????..A.SH.?????????9??2012-12-29?23:18??程序\common\Desktop_.ini
?????文件???????5508??2012-12-29?09:07??程序\common\stu_top.aspx
?????文件????????415??2012-12-29?11:12??程序\common\stu_top.aspx.cs
?????文件???????1737??2012-12-29?11:36??程序\common\st
?????文件???????5533??2012-12-29?17:02??程序\common\tea_top.aspx
?????文件????????415??2012-12-30?04:33??程序\common\tea_top.aspx.cs
?????文件???????5605??2012-12-29?18:30??程序\common\top.aspx
?????文件????????411??2012-12-29?23:01??程序\common\top.aspx.cs
????..A.SH.?????????9??2012-12-29?12:58??程序\css\Desktop_.ini
?????文件???????1739??2012-12-30?06:32??程序\css\st
????..A.SH.?????????9??2012-12-29?22:43??程序\Databa
?????文件????1179648??2012-12-30?00:01??程序\Databa
?????文件????1048576??2012-12-30?03:51??程序\Databa
?????文件????????120??2013-01-02?13:25??程序\Default.aspx
?????文件???????3001??2012-12-29?13:33??程序\Default.aspx.cs
?????文件??????21995??2012-12-29?23:48??程序\images\01.gif
?????文件??????25838??2012-12-29?09:59??程序\images\3.swf
?????文件??????21426??2012-12-30?06:54??程序\images\bg.jpg
?????文件??????13803??2012-12-29?23:47??程序\images\bg_welcome.jpg
?????文件??????41150??2012-12-29?21:48??程序\images\body.gif
?????文件???????1863??2012-12-29?09:38??程序\images\cancel.gif
?????文件???????5003??2012-12-30?00:39??程序\images\clock.swf
?????文件???????5436??2012-12-29?22:45??程序\images\default_01.gif
?????文件???????2643??2012-12-30?05:37??程序\images\default_02.gif
?????文件???????8133??2012-12-29?10:24??程序\images\default_03.gif
............此處省略43個文件信息
評論
共有 條評論