zoukankan      html  css  js  c++  java
  • 批量文件复制

    运行 环境 delphi7

    原代码

    unit Unit1;
    
    interface
    
    uses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls, FileCtrl;
    
    type
      TForm1 = class(TForm)
        Button1: TButton;
        FileListBox1: TFileListBox;
        DriveComboBox1: TDriveComboBox;
        DirectoryListBox1: TDirectoryListBox;
        Edit1: TEdit;
        Edit2: TEdit;
        Button2: TButton;
        procedure Button1Click(Sender: TObject);
        procedure Button2Click(Sender: TObject);
        procedure DirectoryListBox1Change(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;
    
    var
      Form1: TForm1;
    
    implementation
    
    {$R *.dfm}
    
    procedure TForm1.Button1Click(Sender: TObject);
    begin
        filelistbox1.Mask:=Edit1.Text;
    end;
    
    procedure TForm1.Button2Click(Sender: TObject);
    var
      i:integer;
      j:integer;
      s:string;
    
    begin
      try
        s:=filelistbox1.Directory;
        for i:=0 to filelistbox1.Count-1 do
        begin
          if filelistbox1.Selected[i] then
            copyfile(pchar(s+'\'+filelistbox1.Items.Strings[i]),pchar(edit2.Text+'\'+filelistbox1.Items.Strings[i]),False);
        end;
        application.MessageBox('yes','t',0);
      except
        application.MessageBox('not','t',0);
    end;
    end;
    
    procedure TForm1.DirectoryListBox1Change(Sender: TObject);
    begin
    filelistbox1.FileName:=DirectoryListBox1.Directory ;
    
    end;
    
    end.


    界面设计:

  • 相关阅读:
    二维动规思想,j 具有明显枚举特征
    二分法题目总结
    最大(小)值最小(大)化 (二分法变形)
    C/ C++ 输入输出流
    正序扫描字符串问题
    React(基础一)_react中的三大属性
    找位置
    STL vector
    STL stack
    打印日期
  • 原文地址:https://www.cnblogs.com/javawebsoa/p/3057439.html
Copyright © 2011-2022 走看看