- 实验目的
熟练掌握动态网页中数据库的链接操作。
- 实验内容
- 任务1:利用ADO.NET对象实现用户的注册功能。
- 任务2:利用ADO.NET对象实现用户的登录功能。
- 实验环境
Microsoft Visual Studio 2019
- 实验步骤
- 添加解决方案shiyan,并在解决方案中添加两个web窗体,分别表示登录和注册页面,以及新建一个SQL文件夹用于存放数据库文件。
2.分别设计登录和上传的页面设计:
HTML代码如下:
登录页面:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
</head>
<body style="height: 337px">
<form id="form1" runat="server">
<div>
<asp:Label ID="Label3" runat="server" BackColor="White" BorderColor="White" BorderStyle="Double" Enabled="False" Font-Bold="True" Font-Size="XX-Large" Font-Strikeout="False" ForeColor="#FF9999" Text="用户登录界面"></asp:Label>
</div>
<asp:Label ID="Label1" runat="server" Text="用户名" ForeColor="Black"></asp:Label>
<asp:TextBox ID="TextBox1" runat="server" style="margin-left: 10px; margin-top: 30px;" Width="162px"></asp:TextBox>