D7的一个技术问题,请教各位程序员大哥。
NC217 2017-11-05 05:49:02 function MakeFileList(Path,FileExt:string):TStringList ;
var
E1:integer;
sch:TSearchrec;
asch:string;
begin
E1:=0;
Result:=TStringlist.Create;
if rightStr(trim(Path), 1) <> '\' then
Path := trim(Path) + '\'
else
Path := trim(Path);
if not DirectoryExists(Path) then
begin
Result.Clear;
exit;
end;
if FindFirst(Path + '*', faAnyfile, sch) = 0 then
begin
repeat
Application.ProcessMessages;
if ((sch.Name = '.') or (sch.Name = '..')) then Continue;
if DirectoryExists(Path+sch.Name) then
begin
Result.AddStrings(MakeFileList(Path+sch.Name,FileExt));
end
else
begin
if (UpperCase(extractfileext(Path+sch.Name)) = UpperCase(FileExt)) or (FileExt='.*') then
Result.Add(Path+sch.Name);
end;
showmessage(sch.name); //显示每个文件夹里的文件名
renamefile(sch.name,concat(IntToStr(E1),'.ern') ); //改名字和后缀名
showmessage(sch.name);//不能正常显示修改后的名字
INC(E1); //文件名计数变量
until FindNext(sch) <> 0;
SysUtils.FindClose(sch);
end;
end;
中文标识的地方我没办法正常运行呀,我应该怎么写这段代码呢?