O opqwthy Unregistered / Unconfirmed GUEST, unregistred user! 2009-03-06 #1 拜托了各位了,ExtractFileExt函数不行,只能先打开文件才能取后缀名.
L liaj Unregistered / Unconfirmed GUEST, unregistred user! 2009-03-07 #3 var strFile, strExt: string;begin strFile := 'C:/myfile.txt'; strExt := ExtractFileExt(strFile); ShowMessage(strExt); // .txtend;
var strFile, strExt: string;begin strFile := 'C:/myfile.txt'; strExt := ExtractFileExt(strFile); ShowMessage(strExt); // .txtend;
李 李翔鹏 Unregistered / Unconfirmed GUEST, unregistred user! 2009-03-07 #4 ExtractFileExt可以阿!或者自己写一个函数function GetFileExt(FileName : string):string;var i : integer;begin for i := Length(FileName) down to 1 do begin if FileName = '.' then Result := Copy(FileName,i+1,Length(FileName)-i); Break; end;end;
ExtractFileExt可以阿!或者自己写一个函数function GetFileExt(FileName : string):string;var i : integer;begin for i := Length(FileName) down to 1 do begin if FileName = '.' then Result := Copy(FileName,i+1,Length(FileName)-i); Break; end;end;