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.


    界面设计:

  • 相关阅读:
    Java 常用工具类
    Shiro 分析
    Oracle 恢复表操作内容
    Struts2 中的配置文件 package name 、namespace 以及 对象方法调用
    MySql 修改字符集
    命名空间、静态函数、实例函数
    Eclipse Tomcate 热部署
    Java Json
    Mybatis 存储过程调用
    HDFS源码分析心跳汇报之数据结构初始化
  • 原文地址:https://www.cnblogs.com/javawebsoa/p/3057439.html
Copyright © 2011-2022 走看看