登录注册页面实验
WEB开发实验报告
实验题目:用WEB控件实现注册与登录页面 实验类型: 验证性
指导老师:潘凤 班 级: 计科系
姓 名:
一、实验题目
用web控件实现注册与登录页面
二、实验目的和
1. 利用所学知识进行页面开发,充分运用所能使用的服务器控件来实现需求。灵活掌握数据库的连接与访问。
2. 要求页面友好,交互性强。
3. 上机前预习实验,同学们相互间可以讨论;上机过程中要求独立完成;设计出具有各自风格的页面。
三、实验内容
1、用web控件实现简单的用户注册页面。
要运用文本框、单选框、复选框、下拉列表、多行文本框、按钮、图片、文件上传等控件实现注册页面,并实现简单验证。点击提交按钮后讲用户填写的信息提交到display页面显示出来。
2、用web控件实现简单的用户登录页面
运用文本框、label、按钮等控件实现简单的用户登录页面,登录按钮旁加上新用户注册按钮,连接到用户注册页面。用户输入用户名(admin)和密码(admin)后进行验证,输入正确则提示用户欢迎登录,并显示欢迎图片;否则提示用户名或密码错误,显示相应错误提示图片。
四、实验
1、登录页面制作
(1)效果图:
of sampling and sample size shall not be less than 5 pieces of each shipment. For foods that require testing salmonella sampling quantity should be increased, less than 8. After three, sampling methods to determine the sampling plans and sampling method sampling plans for effective implementation and ensure the efficiency of sample representativeness is very important. Sampling must adhere to aseptic operations ... (3) if not carried by hand when the sample can also be checked. Before the shipment of the samples must be packaged, should anti-breakage and anti-frozen or perishable and frozen samples to heat up or melt. On the packaging should be noted as "shatterproof", "perishable," "cold" and so forth. (4) make sample shipping records, clearly state the conditions of transport, dates, locations and other descriptions of arrival, and signed by the carrier. Section II preparation techniques, glassware cleaning and preparation of culture media in the process of, first use of glassware, such as test tubes, flask, Petri dishes, beakers, and straws. These vessels prior to use according to different situations, after some treatment, wash. Some will pack, after sterilization is ready to use. 1, new glass to remove package after contaminated dirt, scrub with hot, soapy water, rinse water, then soak in 1~2% of industrial hydrochloric acid for several hours, free of alkaline material removed, then rinse with water. For larger vessels, such as flasks, graduated cylinders, wash-House, injection of concentrated hydrochloric acid to a little, turn the container be equitably with hydrochloric acid, pour hydrochloric acid after a few minutes, and then rinse with water,bottle for store see light easy decomposition of reagents cannot heating; cannot in bottle within preparation in operation process released large heat of solution; mill mouth plug to keep original; put lye of bottle should using rubber plug, so as not to day long playing not open drops bottled needed drops added of reagents ibid funnel long neck funnel for quantitative analysis, filter precipitation; short neck funnel as general filter points liquid funnel: drops liquid spherical pear shaped tube shaped Two do not mix liquid; for extraction and enrichment (pear-shaped), preparation and liquid in the reaction (more spherical and dropping funnels) grinding cock must be original, leaky hopper cannot be used. Test tubes: common test qualitative analysis of test tubes, centrifuge tubes ... Measuring glassware (such as burettes, pipettes, volumetric, etc): also used SOAP, washing detergent, but not with the hair brush. (2) precision or hard to wash glassware (glassware, liquid tube, volumetric micrcomputer funnel, colorimetric tubes, glass, etc): after rinsing with tap water, drain, then uses chromic acid cleaning fluid for some time (typically over night) and then washed with tap water finally rinse with water 3 times. (3) washing devices, you should first wash hands with SOAP, avoid oil adhering to the instrument in the hands of wall, making it harder to wash. (4) a wash of glassware should not hang beads (wash when the instrument upside down, wall hanging beads for flow out). Three, glassware drying (1) can't wait to dry, such as instruments, can be placed in the equipment rack in a dust-free place to dry. (2) instruments and glassware available
(2)后台代码:
Protected Sub Btn_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles
Btn.Click
Response.BufferOutput = True
Response.Write("用?户?名?或ò密ü码?错洙?误ó!")
If Request.Form("UserName") = "admin" Then
If Request.Form("Pass") = "admin" Then
Response.Redirect("denglu2.aspx")
Else
Response.Flush()
End If
Else
Response.Flush()
End If
End Sub
Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles
Button2.Click
Response.Redirect("Default.aspx")
End Sub
End Class
2、注册页面制作
(1)效果图:
(2)后台代码:
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles
Button1.Click
txt.Text = "姓?名?:阰" & accName.Text & "
"
txt.Text = txt.Text & "年ê龄?:阰" & accAge.Text & "
"
If accPwd1.Text = accPwd2.Text Then
txt.Text = txt.Text & accPwd1.Text & "
"
Else
txt.Text = txt.Text & "
" & "密ü码?错洙?误ó不?予 ?显?示?"
End If
Dim sex As String
sex = accSex.SelectedItem.Text
Dim blood As String
blood = accBlood.SelectedItem.Text
Dim place As String
place = accPlace.SelectedItem.Text
Dim i As Integer
Dim xingqu As String
For i = 0 To accInt.Items.Count - 1
If accInt.Items(i).Selected Then
xingqu = xingqu & " " & accInt.Items(i).Text
End If
Next
Dim xingquaihao As String
xingquaihao = TextBox3.Text
Session("accName") = accName.Text
Session("accAge") = accAge.Text
Session("accPwd1") = accPwd1.Text
Session("sex") = sex
Session("blood") = blood
Session("place") = place
Session("xingqu") = xingqu
Session("jianjie") = TextBox3.Text
Response.Redirect("Default2.aspx")
End Sub
End Class
3、提交页面制作
(1)效果图:
of sampling and sample size shall not be less than 5 pieces of each shipment. For foods that require testing salmonella sampling quantity should be increased, less than 8. After three, sampling methods to determine the sampling plans and sampling method sampling plans for effective implementation and ensure the efficiency of sample representativeness is very important. Sampling must adhere to aseptic operations ... (3) if not carried by hand when the sample can also be checked. Before the shipment of the samples must be packaged, should anti-breakage and anti-frozen or perishable and frozen samples to heat up or melt. On the packaging should be noted as "shatterproof", "perishable," "cold" and so forth. (4) make sample shipping records, clearly state the conditions of transport, dates, locations and other descriptions of arrival, and signed by the carrier. Section II preparation techniques, glassware cleaning and preparation of culture media in the process of, first use of glassware, such as test tubes, flask, Petri dishes, beakers, and straws. These vessels prior to use according to different situations, after some treatment, wash. Some will pack, after sterilization is ready to use. 1, new glass to remove package after contaminated dirt, scrub with hot, soapy water, rinse water, then soak in 1~2% of industrial hydrochloric acid for several hours, free of alkaline material removed, then rinse with water. For larger vessels, such as flasks, graduated cylinders, wash-House, injection of concentrated hydrochloric acid to a little, turn the container be equitably with hydrochloric acid, pour hydrochloric acid after a few minutes, and then rinse with water,bottle for store see light easy decomposition of reagents cannot heating; cannot in bottle within preparation in operation process released large heat of solution; mill mouth plug to keep original; put lye of bottle should using rubber plug, so as not to day long playing not open drops bottled needed drops added of reagents ibid funnel long neck funnel for quantitative analysis, filter precipitation; short neck funnel as general filter points liquid funnel: drops liquid spherical pear shaped tube shaped Two do not mix liquid; for extraction and enrichment (pear-shaped), preparation and liquid in the reaction (more spherical and dropping funnels) grinding cock must be original, leaky hopper cannot be used. Test tubes: common test qualitative analysis of test tubes, centrifuge tubes ... Measuring glassware (such as burettes, pipettes, volumetric, etc): also used SOAP, washing detergent, but not with the hair brush. (2) precision or hard to wash glassware (glassware, liquid tube, volumetric micrcomputer funnel, colorimetric tubes, glass, etc): after rinsing with tap water, drain, then uses chromic acid cleaning fluid for some time (typically over night) and then washed with tap water finally rinse with water 3 times. (3) washing devices, you should first wash hands with SOAP, avoid oil adhering to the instrument in the hands of wall, making it harder to wash. (4) a wash of glassware should not hang beads (wash when the instrument upside down, wall hanging beads for flow out). Three, glassware drying (1) can't wait to dry, such as instruments, can be placed in the equipment rack in a dust-free place to dry. (2) instruments and glassware available
(2)后台代码:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles
Me.Load
Label1.Text = Session("accName")
Label2.Text = Session("accAge")
Label3.Text = Session("accPwd1")
Label4.Text = Session("sex")
Label5.Text = Session("blood")
Label6.Text = Session("place")
Label7.Text = Session("xingqu")
Label7.Text = Session("xingqu")
Label8.Text = Session("jianjie")
End Sub
End Class
五、实验总结
通过本次实验,我熟悉了一些控件的应用,学会了怎么做验证,更巩固了对vb.net的学
习。