第 1页
实验设备名称(或软件平台) Window7操作系统 Microsoft Visual Studio 2010或以上 Microsoft SQL Server 2008或以上 Internet Explorer8 或以上
第 2页
Width=\
C#实现代码(.cs文件):只列出最关键的代码,名称空间引用等辅助代码不要列出;尽量紧凑,减少空行;以下同。 publicpartialclassf3 : System.Web.UI.Page { SqlConnectioncnn = newSqlConnection(\Catalog=tempdb;Integrated Security=True\); protectedvoidPage_Load(object sender, EventArgs e) { Stringnum = Application[\].ToString().Trim(); if (num.Equals(\)) { TextBox1.Text = \暂无用户登录\; } else { TextBox1.Text = \欢迎 \+num+\号登录\; } } protectedvoid Button7_Click(object sender, EventArgs e) { Response.Redirect(\,true);
第 3页
} protectedvoid Button6_Click(object sender, EventArgs e) { Stringnum, pw; num = TextBox2.Text.Trim(); pw = TextBox3.Text.Trim(); String check = \ + num + \ + pw + \; cnn.Open(); SqlCommandonCheck = newSqlCommand(check,cnn); if (null != onCheck.ExecuteScalar()) { Application[\] = num; Response.Write(num + \号已登录\); TextBox1.Text = \欢迎 \ + num + \号登录\; TextBox2.Text = \; TextBox3.Text = \; cnn.Close(); } else { TextBox2.Text = \; TextBox3.Text = \; Response.Write(\不存在或密码输入错误!\); cnn.Close(); }}} 程序运行屏幕截图:能说明功能实现的网页截图或/和SQL Server管理台截图
第 4页