zoukankan      html  css  js  c++  java
  • Delphi 移动目录

     
     
    ----   3、移动目录  

    ----   有了拷贝目录和删除目录的函数,移动目录就变得很简单,只需顺序调用前两个函数即可:  

    function   MoveDir(sDirName:String;
    sToDirName:string):Boolean;
    begin
              if   CopyDir(sDirName,sToDirName)   then
                    if   RemoveDir(sDirName)   then
                          result:=True
                    else
                          result:=false;
    end;

    ///////////////////////////////////////////////
    procedure   TForm1.Button2Click(Sender:   TObject);
    var
        OpStruc:   TSHFileOpStruct;
        frombuf,   tobuf:   Array   [0..128]   of   Char;
    Begin
        FillChar(   frombuf,   Sizeof(frombuf),   0   );
        FillChar(   tobuf,   Sizeof(tobuf),   0   );
        StrPCopy(   frombuf,   'd:\brief\*.* '   );
        StrPCopy(   tobuf,   'd:\temp\brief '   );
        With   OpStruc   DO   Begin
            Wnd:=   Handle;
            wFunc:=   FO_COPY;
            pFrom:=   @frombuf;
            pTo:=@tobuf;
            fFlags:=   FOF_NOCONFIRMATION   or   FOF_RENAMEONCOLLISION;
            fAnyOperationsAborted:=   False;
            hNameMappings:=   Nil;
            lpszProgressTitle:=   Nil;

        end;
        ShFileOperation(   OpStruc   );
    end;
  • 相关阅读:
    使用phantomjs进行刷商务通对话
    利用python打造自己的ftp暴力破解工具
    notepad++开发中常用的插件
    织梦重装漏洞其实并不是那么好利用
    织梦开启调试模式
    网站安全开发人员不可缺少的火狐插件
    dos批量替换当前目录后缀名
    wpf 帧动画
    C 语言 mmap
    C 语言 ioctl
  • 原文地址:https://www.cnblogs.com/zhangzhifeng/p/2276750.html
Copyright © 2011-2022 走看看