⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 unit8.pas

📁 以学习为目的,使用DIPH开发而成,功能强大,是我们的老师提供的!
💻 PAS
字号:
unit Unit8;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  Gauges, Grids, DBGrids, StdCtrls, Db, DBTables, ExtCtrls, ComCtrls;

type
  TForm8 = class(TForm)
    Panel1: TPanel;
    Panel2: TPanel;
    Label1: TLabel;
    Image1: TImage;
    Label2: TLabel;
    Label3: TLabel;
    Edit1: TEdit;
    Edit2: TEdit;
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    Button4: TButton;
    procedure Button3Click(Sender: TObject);
    procedure Button4Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form8: TForm8;

implementation
uses
  filectrl,shellapi;

{$R *.DFM}

procedure TForm8.Button3Click(Sender: TObject);
var
dir:string;
begin
dir:='d:';
if selectdirectory(dir,[sdallowcreate,sdperformcreate,sdprompt],0) then
edit1.Text:=dir;
end;

procedure TForm8.Button4Click(Sender: TObject);
var
dir:string;
begin
dir:='d:';
if selectdirectory(dir,[sdallowcreate,sdperformcreate,sdprompt],0) then
edit2.Text:=dir;
end;

procedure TForm8.Button1Click(Sender: TObject);
var
opstruct:tshfileopstruct;
frombuf,tobuf:array[0..128] of char;
begin
fillchar(frombuf,sizeof(frombuf),0);
fillchar(tobuf,sizeof(tobuf),0);
strpcopy(frombuf,pchar(edit1.Text));
strpcopy(tobuf,pchar(edit2.Text));
with opstruct do
begin
wnd:=handle;
wfunc:=fo_copy;
pfrom:=@frombuf;
pto:=@tobuf;
fflags:=fof_noconfirmation or fof_renameoncollision;
fanyoperationsaborted:=false;
hnamemappings:=nil;
lpszprogresstitle:=nil;
end;
if shfileoperation(opstruct)=0 then
messagebox(handle,'复制完毕','复制信息',mb_ok+mb_iconinformation);
end;

procedure TForm8.Button2Click(Sender: TObject);
begin
  form8.Close;
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -