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

📄 internet_c.cpp

📁 BCB编写的使用SMTP、POP3和FTP的例子
💻 CPP
字号:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "winbase.h"

#include "Internet_c.h"
#include "Ftp_c.h"
#include "Pop3_c.h"
#include "Smtp_c.h"
#include "NNtp_c.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TMailForm *MailForm;
//---------------------------------------------------------------------------
__fastcall TMailForm::TMailForm(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------

void __fastcall TMailForm::Button1Click(TObject *Sender)
{
        FtpForm->Show();        
}
//---------------------------------------------------------------------------

void __fastcall TMailForm::Button2Click(TObject *Sender)
{
        Pop3Form->Show();        
}
//---------------------------------------------------------------------------

void __fastcall TMailForm::Button3Click(TObject *Sender)
{
        SmtpForm->Show();        
}
//---------------------------------------------------------------------------

void __fastcall TMailForm::Image1DblClick(TObject *Sender)
{
        Application->HelpCommand(1,0);        
}
//---------------------------------------------------------------------------






void    TMailForm::UpdateStatus()
{
        StatusBar1->SimpleText = Hint;
}
void __fastcall TMailForm::Button1MouseMove(TObject *Sender,
      TShiftState Shift, int X, int Y)
{
        Hint = "To User Ftp Tool";
        UpdateStatus();        
}
//---------------------------------------------------------------------------

void __fastcall TMailForm::Button2MouseMove(TObject *Sender,
      TShiftState Shift, int X, int Y)
{
        Hint = "To receive your pop3 mail";
        UpdateStatus();        
}
//---------------------------------------------------------------------------

void __fastcall TMailForm::Button3MouseMove(TObject *Sender,
      TShiftState Shift, int X, int Y)
{
        Hint = "Send mail by your SMTP server";
        UpdateStatus();

}
//---------------------------------------------------------------------------

void __fastcall TMailForm::FormMouseMove(TObject *Sender,
      TShiftState Shift, int X, int Y)
{
        StatusBar1->SimpleText = "";
}
//---------------------------------------------------------------------------

void __fastcall TMailForm::Image1MouseMove(TObject *Sender,
      TShiftState Shift, int X, int Y)
{
        StatusBar1->SimpleText = "Thanks for using Internet tool";
}
//---------------------------------------------------------------------------

void __fastcall TMailForm::Button4Click(TObject *Sender)
{
        NNtpForm->Show();
}
//---------------------------------------------------------------------------

void __fastcall TMailForm::Button4MouseMove(TObject *Sender,
      TShiftState Shift, int X, int Y)
{
        StatusBar1->SimpleText = "Internet Newsgroup";
}
//---------------------------------------------------------------------------

void __fastcall TMailForm::FormCloseQuery(TObject *Sender, bool &CanClose)
{
/*
//        Application->MessageBox("K","H",MB_OK);
        if(FtpForm->NMFTP1->Connected)
                FtpForm->NMFTP1->Disconnect();
        if(NNtpForm->NMNNTP1->Connected)
                NNtpForm->NMNNTP1->Disconnect();
        if(Pop3Form->NMPOP31->Connected)
                Pop3Form->NMPOP31->Disconnect();
        if(SmtpForm->NMSMTP1->Connected)
                SmtpForm->NMSMTP1->Disconnect();
*/
        unsigned long ExitCode=0;
        GetExitCodeProcess( MailForm->Handle, &ExitCode);
        ExitProcess(ExitCode);
}
//---------------------------------------------------------------------------

⌨️ 快捷键说明

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