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.


    界面设计:

  • 相关阅读:
    [FJWC2018]全排列
    CYJian的新春虐题赛
    C. 新年的繁荣
    CF809E Surprise me!
    codeforces 1110F
    C. mathematican 的二进制
    [SPOJ] DIVCNT2
    CF1065F Up and Down the Tree
    Snakes 的 Naïve Graph
    「LibreOJ Round #9」CommonAnts 的调和数
  • 原文地址:https://www.cnblogs.com/javawebsoa/p/3057439.html
Copyright © 2011-2022 走看看