注册 登录
编程论坛 ASP技术论坛

[求助]这个过滤看不太明白

cmd2007 发布于 2007-09-03 14:30, 557 次点击
if instr(TheUsername,"'")= 0 and instr(ThePassword,"'")= 0 and instr(TheUsername,"'")=0
and instr(ThePassword,"'")= 0

有三个问题` (1)为什么这里用 = 0?
(2)"'" 这个是什么意思?
(3) 为什么 Username和Password出现2次?
望大家帮忙解答..
6 回复
#2
cmd20072007-09-04 15:22

我的问题``太傻还是`太奇怪``
怎么没人答我啊``
在线等``

#3
hmhz2007-09-04 15:30

if instr(TheUsername,"'")= 0 and instr(ThePassword,"'")= 0 and instr(TheUsername,"'")=0
and instr(ThePassword,"'")= 0

有三个问题` (1)为什么这里用 = 0?
(2)"'" 这个是什么意思?
(3) 为什么 Username和Password出现2次

这是判断 当TheUsername里的值带有“'”单引号 =0 就是没有 “'”单引号

连起来判断就是 判断TheUsername里有没有“'”, instr(TheUsername,"'")= 0 这句就是当“'”为0时就执行下面的程序

#4
cmd20072007-09-04 15:54

明白了啊``不过`为什么会出现2次呢``

#5
hmhz2007-09-04 16:18
if instr(TheUsername,"'")= 0 and instr(ThePassword,"'")= 0 and instr(TheUsername,"'")=0
and instr(ThePassword,"'")= 0

后面这个是多余的
#6
cmd20072007-09-04 16:26
明白了``谢谢你啊``````
#7
gupiao1752007-09-04 16:51

楼主问的都是围着一个VBSCRIPT函数instr,只要知道这个函数就能看得董了,楼主还是应该多看看教材书籍,上面会讲得很详细的!或者WWW.BAIDU.COM里找INSTR,也很容易就能找到相关的详细解释!

1