1、用户注册页面ASP程序设计实验报告 实验题目:制作一个用户注册页面专业班级: 计科系* 姓 名: * 学 号: * 2013年4 月 12日实验报告实验类型_验证_ 实验室_软件实验室一_一、 实验题目制作一个用户注册页面二、 实验目的和要求 熟悉并掌握VB脚本语言,包括数据类型,函数,过程,重点掌握VBscript对象和事件。三、 实验内容 制作一个用户注册页面。四、 实验代码按顺序输入注册信息!Sub Windows_OnloadForm1.xm.FocusEnd SubSub xm_OnkeyPressIf Window.Event.Keycode=13 ThenForm1.mm.Foc
2、usEnd IfEnd SubSub mm_OnkeyPressIf Window.Event.Keycode=13 ThenForm1.qrmm.FocusEnd IfEnd SubSub qrmm_OnkeyPressIf Window.Event.Keycode=13 ThenForm1.nl.FocusEnd IfEnd SubSub nl_OnkeyPressIf Window.Event.Keycode=13 ThenForm1.dh.FocusEnd IfEnd SubSub dh_OnkeyPressIf Window.Event.Keycode=13 ThenForm1.zz
3、.FocusEnd IfEnd SubSub zz_OnkeyPressIf Window.Event.Keycode=13 ThenForm1.email.FocusEnd IfEnd SubSub email_OnkeyPressIf Window.Event.Keycode=13 ThenForm1.button1.FocusEnd IfEnd SubSub button1_OnClickDim txt1,txt2,txt3,txt4,txt5,txt6,txt7,alltxttxt1=Form1.xm.valuetxt2=Form1.nl.valuetxt3=Form1.dh.valu
4、etxt4=Form1.zz.valuetxt5=Form1.mm.valuetxt6=Form1.qrmm.valuetxt7=Form1.email.valueIf txt1= ThenMsgBox姓名不能为空!Form1.xm.FocusExit SubEnd IfIf txt5= ThenMsgBox密码不能为空!Form1.mm.FocusExit SubEnd IfIf Len(txt5)12 ThenMsgBox密码应该在6到12位之间.Form1.mm.FocusExit SubEnd IfIf txt6= ThenMsgBox确认密码不能为空!Form1.qrmm.Focus
5、Exit SubEnd IfIf txt5txt6 ThenMsgBox密码和确认密码不同!Form1.qrmm.FocusExit SubEnd IfIf txt3= ThenMsgBox电话不能为空!Form1.dh.FocusExit SubEnd IfIf not isNumeric(txt2) ThenMsgBox请输入数字!Form1.mm.FocusExit SubEnd IfIf (InStr(,txt7)=0 and InStr(.,txt7)=0) ThenMsgBox请输入有效的E-mail地址!Form1.email.FocusExit SubEnd Ifalltxt=
6、姓名为:+txt1+VbCrlfalltxt=alltxt+密码为:+txt5+VbCrlfalltxt=alltxt+年龄为:+txt2+VbCrlfalltxt=alltxt+电话为:+txt3+VbCrlfalltxt=alltxt+住址为:+txt4Intb=MsgBox(alltxt,4+32,确认提交)if Intb=6 then form1.submitend Ifend subsub button1_onkeypressif window.event.keycode=13 then button1_onclikend ifend sub-姓名:密码:确认密码:年龄:电话:住址:email:五、 实验结果 六、 实验总结通过本次实验,我初步掌握了VB脚本语言的使用,学会了对Vbscript对象和事件的简单应用,虽然在实验中出现了许多问题,但是最终还是解决了,这次实验还是收获了好多,以后会继续努力的。
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1