一个异常的困惑。。。蛋疼好多天了
我的程序里用了EurekaLog来记录用户反馈的错误,最近发现一个很让我很蛋疼的问题
异常信息是:
Invalid characters in path.
异常代码片段
try for Path in PathList do begin if DirectoryExists(Path) then begin FileNameList := TDirectory.GetFiles(Path, '*.exe', TSearchOption.soAllDirectories); // 出错行 for FileName in FileNameList do begin // 一些文件处理代码,略去 end; end; end;except // 这里抓取引发异常的路径,当然还有其他用户反馈的别的路径,各不相同,我只是随机挑出的一个 // Path = 'C:\Program Files\Tencent\QQPCMgr\6.6.2158.401\'end;
if not TPath.HasValidPathChars(Path, False) then raise EArgumentException.CreateRes(@SInvalidCharsInPath); // 异常:Invalid characters in path.