[Delphi (Object Pascal)] delphi实现两个目录路径的链接 →→→→→进入此内容的聊天室

来自 , 2019-04-04, 写在 Delphi (Object Pascal), 查看 115 次.
URL http://www.code666.cn/view/c25e9a36
  1. filepath := PathJoin(['C:', 'path1', 'path2\', 'a.doc']);
  2. // filepath = 'C:\path1\path2\a.doc'
  3. 代码:
  4. function PathJoin(const Args: array of string): string;
  5. var
  6.   len: Integer;
  7.   i: Integer;
  8.   s: string;
  9. begin
  10.   s := '';
  11.   len := length(Args);
  12.   for i := 0 to len-1 do
  13.   begin
  14.     if s = '' then
  15.     begin
  16.       s := s + Args[i]
  17.     end
  18.     else
  19.     begin
  20.       if Args[i] <> '' then
  21.         s := IncludeTrailingPathDelimiter(s) + Args[i];
  22.     end;
  23.   end;
  24.   Result := s;
  25. end;
  26. //delphi/6399

回复 "delphi实现两个目录路径的链接"

这儿你可以回复上面这条便签

captcha