本文整理自网络,侵删。
function IsValidFilename(const fname: String): Boolean;const InvalidChars : set of char = ['\', '/', ':', '*', '?', '"', '<', '>', '|'];var I: Integer;begin Result := fname <> '';
if Result then begin for I := 1 to Length(fname) do begin Result := NOT (fname[I] in InvalidChars); if NOT Result then Break; end; end;end;
相关阅读 >>
更多相关阅读请进入《Delphi》频道 >>