本文整理自网络,侵删。
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 firemonkey中listboxaccessory图标切换
Delphi 用 superobject 解析淘宝上的 json 数据
Delphi防止因系统崩溃而丢失任务栏的图标(重建托盘图标)
更多相关阅读请进入《Delphi》频道 >>