如何在查询中检查CAPS锁定 [英] How to check for CAPS lock in a query
问题描述
我尝试了什么:
用户名:admin&密码:admin
它运行正常,但当我输入用户名:ADMIN&密码:ADMIN
它应该是一个错误,但它仍然加载我的消息框
msgbox( 登录成功!)
无论如何接受用户名是很正常的当时的用户类型:事实上,许多系统都是故意不区分大小写的用户名比较...但是如果你的密码不区分大小写那么这意味着你做了非常非常错误的事情,而且这个错误通常是用纯文本存储密码。
切勿以明文形式存储密码 - 这是一个主要的安全风险。有关如何在此处执行此操作的信息:密码存储:如何做到这一点。 [ ^ ] - 代码是C#,但它非常明显,如果你无法解决问题,还有在线转换器: C#转VB转换器 [ ^ ]
引用:如何检查查询中的CAPS锁
简答:你不需要,这里没用。 CAPS lock是键盘状态,与用户输入无关。
要转换或测试用户输入是小写还是大写,请使用ToLower
或ToUpper
字符串函数。
Hi guys! I don't know how to check for Caps lock in a query. For example I have a Access Database with a few fields (Username,Password). Now here is the problem, when I debug I typed the following information (Correct Data from Access Database)
What I have tried:
Username : admin & Password : admin
It works fine but when I put Username : ADMIN & Password : ADMIN
it should be an error but it still loads my messagebox
msgbox("Login Successful!")
It's pretty normal to accept usernames in whatever case your user types at the time: indeed, many systems are deliberately case-insensitive with username comparisons ... but if your password is case insensitive then that means you have done something very, very wrong, and that error is normally storing passwords in plain text.
Never store passwords in clear text - it is a major security risk. There is some information on how to do it here: Password Storage: How to do it.[^] - the code is C# but it's pretty obvious, and there are online converters if you can't work it out: C# to VB converter[^]
Quote:How to check for CAPS lock in a query
Short answer: You don't need, it is useless here. "CAPS lock" is keyboard status and is not related to user input.
To convert or test if user input is lowercase or uppercase, useToLower
orToUpper
string functions.
这篇关于如何在查询中检查CAPS锁定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!