温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:我的VS2008通讯录项目源码
当前文件:
MyPhoneBook/Mypb/login.aspx.cs,打开代码结构图
MyPhoneBook/Mypb/login.aspx.cs,打开代码结构图1using System.Data.OleDb; 2
using System; 3
using System.Collections; 4
using System.Configuration; 5
using System.Data; 6
using System.Linq; 7
using System.Web; 8
using System.Web.Security; 9
using System.Web.UI; 10
using System.Web.UI.HtmlControls; 11
using System.Web.UI.WebControls; 12
using System.Web.UI.WebControls.WebParts; 13
using System.Xml.Linq; 14
namespace Mypb 15
{ 16
public partial class login : System.Web.UI.Page 17
{ 18
protected void Page_Load(object sender, EventArgs e) 19
{ 20
this.Title = "登录"; 21
TextBox1.Focus(); 22
23
} 24
25
protected void Button1_Click(object sender, EventArgs e) 26
{ 27
28
if(TextBox1.Text=="51aspx" && TextBox2.Text=="51aspx") 29
{ 30
Response.Redirect("default.aspx");} 31
32
else 33
{ Response.Write("<script language=javascript>alert('Sorry,您不是管理员,请单击访问者进入!');</script>"); 34
35
} 36
37
38
} 39
40
protected void Button2_Click(object sender, EventArgs e) 41
{ 42
Response.Redirect("wrong.aspx"); 43
} 44
45
46
} 47
} 48
49





}
}