用asp 登陆网页代码。。急
发布网友
发布时间:2023-08-05 06:57
我来回答
共1个回答
热心网友
时间:2024-12-04 10:32
sqlconnection
myconn
=
new
sqlconnection("server=(local);database=chaoshi;uid=sa;pwd=100427");
myconn.open();
sqlcommand
mycomm
=
new
sqlcommand("select
count(*)
from
yonghu
where
id='"
+
textbox1.text.trim()
+
"'and
pwd='"
+
textbox2.text
+
"'",
myconn);
int
i
=
(int)mycomm.executescalar();
if
(i
==
0)
{
response.write("<script>alert('用户名或密码不正确!')</script>");
}
else
{
response.write("<script>alert('登录成功!')</script>");
}