📄 unit1.cpp
字号:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
if(OpenDialog1->Execute())
Edit1->Text=OpenDialog1->FileName;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button2Click(TObject *Sender)
{
if(OpenDialog1->Execute())
Edit2->Text=OpenDialog1->FileName;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button3Click(TObject *Sender)
{
String filename1,filename2;
HANDLE findfile;
WIN32_FIND_DATA FIND;
if(Edit1->Text==""||Edit2->Text=="")
{
ShowMessage("请输入文件名称!");
return;
}
filename1=Edit1->Text;
filename2=Edit2->Text;
findfile=FindFirstFile(filename1.c_str(),&FIND);
if(findfile==INVALID_HANDLE_VALUE)
{
ShowMessage("源文件不存在或文件名错误!");
return;
}
else
FindClose(findfile);
Animate1->CommonAVI=aviCopyFile;
Animate1->Active=true;
if(CopyFile(filename1.c_str(),filename2.c_str(),0))
{
Animate1->Active=false;
ShowMessage("文件复制成功!");
}
else
ShowMessage("文件复制失败!");
}
//---------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -