asp有问题!!

来源:百度知道 编辑:UC知道 时间:2024/05/30 12:14:22
<%
dim username
username=trim(request.Cookies("shopxp")("username"))
if request.Cookies("shopxp")("reglx")=代号 then
response.write "¥"&rs("shopxpvjia")&"元"
else
response.write "0"
end if
%>
怎么样做才可以不管“代号“是1还是2都可以输出shopxpvjia

<%
dim username
username=trim(request.Cookies("shopxp")("username"))
if request.Cookies("shopxp")("reglx")=1 or request.Cookies("shopxp")("reglx")=2 then '1或者2都输出
response.write "¥"&rs("shopxpvjia")&"元"
else
response.write "0"
end if
%>

<%
dim username
username=trim(request.Cookies("shopxp")("username"))
'if request.Cookies("shopxp")("reglx")=代号 then
response.write "¥"&rs("shopxpvjia")&"元"
'else
'response.write "0"
'end if
%>

把上面的判断条件去掉试试,不过这样修改代码,似乎不太科学了。
呵呵