Request.Form.Count=0 then起什么作用

来源:百度知道 编辑:UC知道 时间:2024/05/08 13:10:37
代码如下
<HTML>
<BODY>
<TITLE>
用户登录
</TITLE>
<%
if Request.Form.Count=0 then
%>
请输入用户名和密码
<FORM ACTION="login.asp" METHOD="post">
<Table border=0>
<tr><td>用户名:</td>
<td><INPUT TYPE=text NAME=username VALUE=""></td>
</tr>
<tr><td>密码:</td>
<td><INPUT TYPE=password NAME=password VALUE=""></td>
</tr>
</Table>
<INPUT TYPE=Submit VALUE=确认提交>
<INPUT TYPE=reset VALUE=重新输入>
</FORM>

<%else%>
<%
Dim user
dim pwd
user=Request.Form("username")
pwd=Request.Form("password")

if user="fenfang" then
if pwd="1234" then
Response.write "用户登录成功"

if Request.Form.Count=0 then
count 就是返回的结果集合为0
count是总数的意思
这句在网页中是没有返回值

其实也可以使用if Request.Form("username") ="" or Request.Form("username")=null then
来代替
不过我没有用过count

你确认你的代码没问题?应该是 request.form(count)=0吧?