📄 unit1.cpp
字号:
//Write By tangse
//www: http://tang_se.top263.net http://tangse.myetang.com
//email:tangse2@263.net
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "shellapi.h"
#include "Unit2.h"
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
int time;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::SpeedButton1Click(TObject *Sender)
{
if(OpenDialog1->Execute())
ListBox1->Items->Add(OpenDialog1->FileName);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::SpeedButton2Click(TObject *Sender)
{
if(ListBox1->ItemIndex!=-1)
ListBox1->Items->Delete(ListBox1->ItemIndex);
}
void __fastcall TForm1::ListBox1MouseMove(TObject *Sender,
TShiftState Shift, int X, int Y)
{
if(ListBox1->ItemIndex!=-1)
ListBox1->Hint=ListBox1->Items->Strings[ListBox1->ItemIndex];
}
//---------------------------------------------------------------------------
void __fastcall TForm1::SpeedButton3Click(TObject *Sender)
{
ShellExecute(NULL,"open","http://tang_se.top263.net","","",SW_NORMAL);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::SpeedButton4Click(TObject *Sender)
{
forms=0;time=0;
int fp;TotalSize=0;MailSize=0;
for(int i=0;i<ListBox1->Items->Count;i++){
fp=FileOpen(ListBox1->Items->Strings[i],fmOpenRead);
if(fp==-1){ListBox1->Items->Delete(i);continue;}
MailSize+=FileSeek(fp,0,2)/1024;
FileClose(fp);
}
MailSize+=1+Memo1->Text.Length()/1024;
terminated=false; count=0;
sum=StrToInt(Edit6->Text);
int c=StrToInt(Edit10->Text);
for(int i=0;i<c;i++){
TForm2 *frm=new TForm2(Form1);
forms++;
frm->Show();
StaticText3->Caption=IntToStr(forms);
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::SpeedButton5Click(TObject *Sender)
{
terminated=true;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::SpeedButton7Click(TObject *Sender)
{
Panel1->Visible=!Panel1->Visible;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormCanResize(TObject *Sender, int &NewWidth,
int &NewHeight, bool &Resize)
{
Resize=false;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Edit10KeyPress(TObject *Sender, char &Key)
{
if(!((Key>='0'&&Key<='9')||Key==VK_BACK))Key='\0';
}
//---------------------------------------------------------------------------
void __fastcall TForm1::SpeedButton6Click(TObject *Sender)
{
Application->Terminate();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Timer1Timer(TObject *Sender)
{
time++;
StaticText2->Caption=IntToStr((BYTE)time/60)+"分钟"+IntToStr((BYTE)time%60)+"秒";
if(Memo1->Lines->Count>200)Memo1->Lines->Clear();
}
//---------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -