// 效验文件名function ValidFileName(const FileName: string): Boolean;
function HasAny(const Str, Substr: string): Boolean;
var
I: Integer;
begin
Result := False;
for I := 1 to Length(Substr) do begin
if Pos(Substr[I], Str) > 0 then begin
Result := True;
Break;
end;
end;
end;
begin
Result := (FileName <> '') and (not HasAny(FileName, '<>"[]|'));
if Result then Result := Pos('\', ExtractFileName(FileName)) = 0;
end;
function HasAny(const Str, Substr: string): Boolean;
var
I: Integer;
begin
Result := False;
for I := 1 to Length(Substr) do begin
if Pos(Substr[I], Str) > 0 then begin
Result := True;
Break;
end;
end;
end;
begin
Result := (FileName <> '') and (not HasAny(FileName, '<>"[]|'));
if Result then Result := Pos('\', ExtractFileName(FileName)) = 0;
end;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货