long n,t
boolean b
s=sle_1.text//用戶輸入的密碼
t=lenw(s)//取得s的總長度
if t=0 then return//空密碼串不處理
b=false
for n=1 to t
c=midw(s,n,1)//依次取字符
if not (isnumber(c)) then//如果字符不是數字,設置標誌
b=true
exit
end if
next
if b=false then//如果所有字符都是數字
messagebox('提示','密碼不能是純數字串!')
return
end if
b=false
for n=1 to t
c=midw(s,n,1)//依次取字符
if not ((asc(c)>=65 and asc(c)<=90) or (asc(c)>=97 and asc(c)<=122)) then//如果字符不是字母,設置標誌
b=true
exit
end if
next
if b=false then//如果所有字符都是字母
messagebox('提示','密碼不能是純字母串!')
return
end if