function getfilename(path:string):string ; //取文件名函数
var
temps:string;
tempi:integer;
begin
temps:=StrRscan(pchar(path),'\');
tempi:=length(temps)-1 ;
getfilename:=rightstr(temps,tempi);
end;
比如:d:\book\good.txt 可以得到good.txt,但要是d:\book\文件.txt 就得到的是 \文件.txt,这是怎么回事,怎样才能解决?
var
temps:string;
tempi:integer;
begin
temps:=StrRscan(pchar(path),'\');
tempi:=length(temps)-1 ;
getfilename:=rightstr(temps,tempi);
end;
比如:d:\book\good.txt 可以得到good.txt,但要是d:\book\文件.txt 就得到的是 \文件.txt,这是怎么回事,怎样才能解决?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货