永发信息网

VB.NET设置用户名,密码?

答案:2  悬赏:40  手机版
解决时间 2021-03-15 08:45
  • 提问者网友:孤凫
  • 2021-03-14 12:58
如何写代码,用户名123,密码123,登陆进入下一个窗体.我编的.不过运行后,点登陆没反映啊.??求助.If TextBox1.Text = "123"& TextBox2.Text = "123" Then
Me.Visible = False
frm2.ShowDialog()
Me.Visible = True End If
最佳答案
  • 五星知识达人网友:纵马山川剑自提
  • 2021-03-14 13:46
If TextBox1.Text = "123"& TextBox2.Text = "123" Then
改成 If TextBox1.Text = "123" and TextBox2.Text = "123" Then
全部回答
  • 1楼网友:渡鹤影
  • 2021-03-14 15:13
using system; using system.data; using system.data.oledb; ''' 查询用户名是否存在, 存在返回true, 否则返回false private function namevalidate(uname as string) as boolean dim olecon as oledbconnection = new oledbconnection() olecon.connectionstring = "provider=microsoft.jet.oledb.4.0;data source=" & 数据库路径 '这里的路径自己设置下 olecon.open() dim cmd as oledbcommand = new oledbcommand("select count(*) from tablename where uname='" & uname & "'", olecon) 'sql语句记得改为自己的 dim result as integer = cmd.executescalar() olecon.close() olecon.dispose() if result > 0 then return true else return false end if end function
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯