當前位置:編程學習大全網 - 網站源碼 - PB實現,要求用戶更改的密碼不能單純為數字,也不能單純為字母,該怎麽實現

PB實現,要求用戶更改的密碼不能單純為數字,也不能單純為字母,該怎麽實現

string s,c

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

  • 上一篇:辨別博樂達滋養調理面膜的真偽,如何檢查滋養調理面膜的真偽?
  • 下一篇:BI 數據支持的類型有哪些
  • copyright 2024編程學習大全網