資源簡介
我們小組實訓做的作業。現在拿出來和大家分享一下。希望有助于大家學習。 此為WEB版 使用。NET平臺開發。

代碼片段和文件信息
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.Data.SqlClient;
using?WorkerManage;
public?partial?class?_Default?:?System.Web.UI.Page?
{
????data?da?=?new?data();
????public?SqlConnection?sqlconn;
????protected?void?Page_Load(object?sender?EventArgs?e)
????{
????????sqlconn?=?da.link();
????????Session[“name“]?=?TextBox1.Text;
????????Session[“password“]?=?TextBox2.Text;
????????//Session[“name1“]?=?Session[“name“].ToString();
????????if?(!IsPostBack)
????????{
????????????string?username?=?Cookies.GetCookiesValue(“Consumer“?“username“);
????????????if?(username?!=?null)
????????????????TextBox1.Text?=?username;
????????}
????}
????//登錄
????protected?void?Button1_Click(object?sender?EventArgs?e)
????{
????????Cookies.DeleteCookies(“Consumer“);
????????Cookies.AddCookies(“Consumer“?DateTime.Now.AddYears(1)?TextBox1.Text);
????????string?a?=?null?b?=?null;
????????string?commtext?=?“select?*?from?Worker?where?WorkerLogin=‘“?+?Session[“name“]?+?“‘?and?WorkerPassword=‘“+TextBox2.Text+“‘“;
????????SqlCommand?sqlcomm?=?new?SqlCommand(commtext?sqlconn);
????????SqlDataAdapter?sqlda?=?new?SqlDataAdapter(commtext?sqlconn);
????????DataSet?ds?=?new?DataSet();
????????sqlda.Fill(ds?“Worker“);
????????if?(ds.Tables[0].Rows.Count?>=?1)
????????{
????????????Session[“WorkerID“]?=?ds.Tables[0].Rows[0][0].ToString();
????????????Session[“branchnumID“]?=?ds.Tables[0].Rows[0][6].ToString();
????????????Session[“name1“]?=?ds.Tables[0].Rows[0][1].ToString();
????????}
????????SqlDataReader?reader?=?sqlcomm.ExecuteReader();
????????reader.Read();
????????try
????????{
????????????a?=?reader.GetValue(2).ToString();
????????????b?=?reader.GetValue(3).ToString();
????????}
????????catch
????????{
????????????//Response.Write(“ript?language=javascript>window.location.href=(‘users.aspx‘) ript>“);
????????????//Response.Redirect(“~/Enter.aspx“);
????????????Label1.Visible?=?true;
????????????Label1.Text?=?“用戶不存在,請重試!“;
????????}
????????if?(a?==?TextBox1.Text)
????????{
????????????if?(b?==?TextBox2.Text)
????????????{
????????????????Session[“name“]?=?TextBox1.Text;
????????????????Response.Redirect(“~/EmployeeInformationManage/EmployeeInformationManage.aspx“);
????????????????//Label1.Visible?=?true;
????????????????//Label1.Text?=?“成功“;
????????????}
????????????else
????????????{
????????????????//Response.Redirect(“~/Enter.aspx“);
????????????????Label1.Visible?=?true;
????????????????Label1.Text?=?“密碼錯誤,請重試!“;
????????????????TextBox2.Text?=?““;
????????????}
????????}
????????else
????????{
????????????//Response.Redirect(“~/Enter.aspx“);
????????????Label1.Visible?=?true;
????????????Label1.Text?=?“用戶不存在,請重試!“;
????????????TextBox1.Text?=?““;
????????????TextBox2.Te
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????3138??2008-06-24?11:53??web\MasterPage.master
?????文件????????417??2008-06-11?08:00??web\MasterPage.master.cs
?????文件???????1176??2008-06-19?14:45??web\Global.asax
?????文件???????3126??2008-06-19?15:22??web\Enter.aspx.cs
?????文件???????2105??2008-06-20?16:13??web\Enter.aspx
?????文件?????159744??2003-11-18?00:12??web\Bin\FreeTextBox.dll
?????文件?????????40??2008-06-07?18:21??web\Bin\FreeTextBox.dll.refresh
?????文件???????1934??2008-06-13?07:45??web\web.config
?????文件???????5182??2008-06-24?11:51??web\LeaveRefer\HistoryLog.aspx
?????文件???????4520??2008-06-24?11:50??web\LeaveRefer\CancelLeave.aspx
?????文件???????3960??2008-06-19?11:58??web\LeaveRefer\CancelLeave.aspx.cs
?????文件???????8468??2008-06-19?11:39??web\LeaveRefer\HistoryLog.aspx.cs
?????文件??????20556??2008-06-20?15:38??web\LeaveRefer\EmployeeLeave.aspx.cs
?????文件???????7730??2008-06-17?15:03??web\LeaveRefer\EmployeeLeave.aspx
?????文件???????1194??2008-06-11?09:23??web\App_Code\Cookies.cs
?????文件???????2851??2008-06-16?09:50??web\App_Code\data.cs
?????文件???????5785??2008-06-07?19:01??web\App_Code\Jsc
?????文件??????31830??2008-06-11?08:20??web\image\Snap2.jpg
?????文件??????12646??2008-06-11?08:23??web\image\top.jpg
?????文件????2359350??2008-05-22?16:31??web\image\1.bmp
?????文件????2359350??2008-05-22?16:31??web\image\2.bmp
?????文件?????156154??2008-05-22?16:31??web\image\77e23224f2ea3925d5074291.jpg
?????文件??????64891??2008-05-22?16:31??web\image\970fea604950e2980162d12a4fbc508e0396.jpg
?????文件?????170483??2008-05-22?16:31??web\image\183920_1744635456_eckqcrgc.jpg
?????文件?????135209??2008-05-22?16:31??web\image\200691652343065.jpg
?????文件??????49330??2008-05-22?16:31??web\image\200713017936138.jpg
?????文件??????51009??2008-05-22?16:31??web\image\2006121614816284.png
?????文件?????161777??2008-05-22?16:31??web\image\2007110220232473404.jpg
?????文件?????223320??2008-05-22?16:31??web\image\bbd14.jpg
?????文件??????28521??2004-08-17?20:00??web\image\Blue?hills.jpg
............此處省略40個文件信息
評論
共有 條評論