2015-09-07 84 views
0

我正在编写脚本来检查我的密码字符串是否至少包含一个特殊字符。我学会了InnoSetup不可能使用正则表达式。Inno设置如何检查一个字符串是否包含至少一个特殊字符

有人可以帮助我实现这个目标吗?

由于事先

节目播音员

+2

什么是*特殊字符*?它是你想要声明的某个常量集合中的一个字符吗? – TLama

+1

你可以在Inno Setup中使用正则表达式。来自某个外部图书馆,或者使用'VBScript.RegExp' Windows自动化对象。但是对于你所描述的声音来说,正则表达式有点沉重。 – TLama

+0

@TLama,感谢您的信息... – DeeJay007

回答

5
[code] 
function PasswordContainsAtLeastOneSpecialChar(Pass : String) : Boolean; 
var 
    i : integer; 
begin 
    Result := false; 

    for i:=1 to length(Pass) do 
    begin 
     case Pass[i] of 
      '!', '"', '§', '$', '%', '&', '/', '(', ')', '=', '?', '\', '*', '#': // list all special characters here 
      begin 
      Result := true; 
      Exit; 
      end; 
     end; 
    end;       
end; 
+0

感谢您的功能,它的功能就像一个魅力.. – DeeJay007

相关问题