ExtractFilePath是什莫意思?在线等?
解决方案 »
- delphi写的DLL怎么给C++ Builder使用啊?
- MD5问题
- 问题:光标位置输入和记录操作的字符串运行?
- 求教:如果动态调整DBGrid的行的颜色? --->>> 是指在运行期时根据当前选定记录的不同而动态变化的。
- 关于COM+服务远程管理
- 文本文件中约有1万行的ip地址,一个地址占一行。要求:统计出总行数,并找出出现次数最多的3个ip
- 处女作发布,望大家能给予指点
- 哎呀,这可怎么办哪?
- delphi6的updata pack1解决了什么问题?pack2解决了什么问题?谢谢
- DGgrid的问题
- 请教各位哥哥姐姐一个菜问题,帮帮忙好吗?(在线等)
- delphi7的crack文文件(dent.slip) 谁有mail给我谢谢!
返回一个文件的路径
Returns the drive and directory portions of a file name.
DescriptionThe resulting string is the leftmost characters of FileName, up to and including the colon or backslash that separates the path information from the name and extension. The resulting string is empty if FileName contains no drive and directory parts.Note: This function works for multi-byte character systems (MBCS).
反回文件的驱动器和路径的名字
extractfilepath(application.exename);
返回应用程序本身所在的文件夹ExtractFilePath('c:\xx\abc.txt');
结果是
c:\xx\
ExtractFilePath(Application.Exename); (因为没有 ExtractFileDir() 函
数)
Delphi 2.0 的 SysUtils 单元中有 ExtractFileDir 与 ExtractFilePath
两个类似的函数, 用哪一个并没有太大的关系, 不过有以下的差异:
[INLINE] ExtractFilePath 传回值的最後一个字元是反斜线
procedure TForm1.Button1Click(Sender: TObject);
begin
ShowMessage(ExtractFileDir(Application.Exename));
(* ==> ie: c:\temp *)
ShowMessage(ExtractFilePath(Application.Exename));
(* ==> ie: c:\temp\ *)
end;
[INLINE] 相同的是,
[INLINE] 1. 只有档名时, 两者传回值都是空字串; 另外,
[INLINE] 2. 如果传入的引数为 C:\Temp.txt 的话, 两者的传回值的最後字
元都是 '\'