欢迎来到天天文库
浏览记录
ID:44209847
大小:1.12 MB
页数:30页
时间:2019-10-19
《VB实验课后习题答案(常州工学院)》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、1、登录系统PublicClassFormlDimrightnameAsStringDimright^passwordAsStringDimkeycountAsInteger=0'输入的次数DimyhmAsStringDimklAsStringPrivateSubButtonl_Click(ByValsenderAsSystem・Object,ByVaieAsSystem.EventArgs)HandlesButtonl.ClickTextBoxl.Focus()yhm二Strings.RTrim(TextBoxl.Text)kl=Strings.RTrim(TextB
2、ox2.Text)Tfyhm=rightnameAndkl=rightpasswordThenMe.Hide()Form2.Show()Elselfyhm<>rightnameThenMe.Hide()MessageBox.Show(”登录信息错误,请检查后重新输入!”,"提示",MessageBoxButtons.OK,MesscigeBoxlcon.Error)Me.Show()TextBoxl.SelectAll()TextBoxl.Focus()keycount=keycouni+1Elselfkl<>right_passwordThenMe.HideOMess
3、ageBox.Show(”登录信息错误,请检查后重新输入!”,"提示",MessageBoxButtons.OK,MessageBoxlcon・Error)Me.Show()TextBox2.SeiectAl1()TcxtBox2.Focus0keycount二keycount+1EndIfIfkeycount=3ThenButton2Click(sender,e)EndTfEndSubPrivateSubTextBoxl_KeyPressl(ByVaisenderAsObject,ByVaieAsSystem・Windows・Forms・KeyPressEventAr
4、gs)HandlesTextBox1・KeyPressIfe.KeyChar=Chr(13)ThenTextBox2.Focus()EndIfIfe.KeyChar>="A"Ande.KeyChar<="Z"Ore.KeyChar=Chr(8)Thene.Handled=FalseElsee・Handled=TrueEndIfEndSubPrivateSubTextBox2KeyPress(ByValsenderAsObject,ByValeAsSystem・Windows・Forms・KeyPressEventArgs)HandlesTcxtBox2・KeyPress
5、Ife.KeyChar=Chr(13)ThenButtonlClick(sender,e)EndIfEndSubPrivateSubButton2Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton2.ClickEndEndSub''''''正确的用户名及对应的口令'''……'八PrivateSubFoi'
6、ml_Load(ByValsenderAsSystem・0bject,ByValeAsSystem.EventArgs)HandlesMyBase.Loadrightname="GAOWET"right_password="123456"EndSubEndClass2、五金商品店ImportsSystem・10ImportsSystem・TextPublicClassForml'''〈summary〉'''定义--个结构体,用来存储商品数据''''''PrivateStructuretagProductPubli
7、cNoAsIntegerPublicNameAsStringPublicNumericAsIntegerPublicPriceAsSingleEndStructurePrivatem_productAstagProduct=Nothing'定义-个商品变吊:,用來保存当前商品DimcountAsInteger=0PrivateSubButtonlClick(ByValsenderAsSystem.Object,ByVaieAsSystem.EventArgs)HandlesButtonl.Clickm
此文档下载收益归作者所有