如何在vb.net中重新输入密码? [英] How to do the retype password in vb.net?

查看:233
本文介绍了如何在vb.net中重新输入密码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我曾尝试将重新输入的密码放在我的vb.net上,但需要在验证通知之前先将其保存。



I have tried to put the re-type password on my vb.net but it need to be save it first before the validation notifies.

If txtpassword.Text <> txtcpassword.Text Then
            MsgBox("Password not Match!,Please Re-type.", MsgBoxStyle.Critical)
            txtcpassword.Text = ""
            txtcpassword.Focus()
            Exit Sub

推荐答案

如果您实际上使用的是VB.NET,那么这将无法工作,因为MsgBox会导致显示在服务器上,而不是CLient - 所以用户不会看到它。在这种情况下,您可能希望使用Javascript进行比较,因为在用户满意之前不需要离开浏览器。请参阅此处: http://keithscode.com/tutorials/javascript/3-a -simple-javascript-password-validator.html [ ^ ]



如果您在Windows应用程序中使用VB,上面的代码应该可以工作 - 所以我要么不理解你的问题,或问题出在代码的其他地方。
If you are actually using VB.NET, then that won't work because MsgBox will cause a display at teh Server, not the CLient - so the user won't see it. In that case, you probably want to use Javascript to do the comparison, as it doesn't need to leave the browser until the user is happy. See here: http://keithscode.com/tutorials/javascript/3-a-simple-javascript-password-validator.html[^]

If you are using VB in a Windows application, your code above should work - so either I don't understand your question, or the problem is elsewhere in your code.


这篇关于如何在vb.net中重新输入密码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆