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

📄 unit8.cpp

📁 1.目录GPS_Bus为工程文件
💻 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 + -