且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何从数据库中检索值并将其与字符串进行比较

更新时间:2023-01-21 13:11:47

显而易见的答案是:用户标识和密码不匹配,因此不返回任何内容。

使用调试器,单步执行代码并检查确切地说发生了什么,以及各种变量中的内容。



但请不要这样做:永远不要以明文形式存储密码 - 这是一个主要的安全措施风险。有关如何在此处执行此操作的信息:密码存储:如何做到这一点。 [ ^ ] - 它在C#中,但代码非常明显。
The obvious answer is: the userid and password do not match, so nothing is returned.
Use the debugger, to single step through your code and check exactly what is happening, and what is in the various variables.

But please, don't do that: 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.[^] - it's in C#, but the code is pretty obvious.