?? unit8.cpp
字號:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit8.h"
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm8 *Form8;
extern CInfo m_info;
extern CSmpp m_smpp;
//---------------------------------------------------------------------------
__fastcall TForm8::TForm8(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm8::Button2Click(TObject *Sender)
{
//測試連接
//定位連接
char* locationip = new char[ Edit1->Text.Length() + 1 ];
strcpy( locationip, Edit1->Text.c_str() );
char* locationuser = new char[ Edit3->Text.Length() + 1 ];
strcpy( locationuser, Edit3->Text.c_str() );
char* locationpassword = new char[ Edit4->Text.Length() + 1 ];
strcpy( locationpassword, Edit4->Text.c_str() );
int locationport = atoi(Edit2->Text.c_str());
if (m_info.Connect(locationip,locationport)==false)
ShowMessage("定位連接不成功!!");
else
{
ShowMessage("恭喜,定位連接成功!!");
if (m_info.Start(locationuser,locationpassword)==false)
ShowMessage("定位帳號或密碼錯誤,請重試!");
}
delete locationip;
delete locationuser;
delete locationpassword;
//短信連接
char* messageip = new char[ Edit5->Text.Length() + 1 ];
strcpy( messageip, Edit5->Text.c_str() );
char* messageuser = new char[ Edit7->Text.Length() + 1 ];
strcpy( messageuser, Edit7->Text.c_str() );
char* messagepassword = new char[ Edit8->Text.Length() + 1 ];
strcpy( messagepassword, Edit8->Text.c_str() );
int messageport = atoi(Edit6->Text.c_str());
if (m_smpp.Connect(messageip,messageport)==false)
ShowMessage("短信連接不成功!!");
else
{
ShowMessage("恭喜,短信連接成功!!");
if (m_smpp.Verify(messageuser,messagepassword)==false)
("短信帳號或密碼錯誤,請重試!");
}
delete messageip;
delete messageuser;
delete messagepassword;
}
//---------------------------------------------------------------------------
void __fastcall TForm8::Button1Click(TObject *Sender)
{
Edit1->Text = Edit1->Text;
Edit2->Text = Edit2->Text;
Edit3->Text = Edit3->Text;
Edit4->Text = Edit4->Text;
Edit5->Text = Edit5->Text;
Edit6->Text = Edit6->Text;
Edit7->Text = Edit7->Text;
Edit8->Text = Edit8->Text;
Form8->Close();
}
//---------------------------------------------------------------------------
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -