本文整理自网络,侵删。
function IsValidFileName(const fileName: string): boolean;
const
InvalidCharacters : set of char = ['\', '/', ':', '*', '?', '"', '<', '>', '|'];
var
cnt : integer;
begin
result := fileName <> '';
if result then
begin
for cnt := 1 to Length(fileName) do
begin
result := NOT (fileName[cnt] in InvalidCharacters) ;
if NOT result then break;
end;
end;
end;
相关阅读 >>
Delphi编写的android程序获取root权限实现(2015.4.15更新,支持android 4.4)
更多相关阅读请进入《Delphi》频道 >>