unit1.~cpp

来自「这个是vc方式下开发的短信发送例子,根据这个例子可以开发出自己要求的短信程序」· ~CPP 代码 · 共 37 行

~CPP
37
字号
//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "POSTMSG30Lib_OCX"
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Button1Click(TObject *Sender)
{
long rs;
char* str1="137";
wchar_t strto[100];
wchar_t content[]=L"test";
wchar_t user[]=L"user";
wchar_t pass[]=L"pass";
wchar_t pid[]=L"";

MultiByteToWideChar (CP_ACP, 0, str1, -1, strto,100);

rs = msg1->Post(user,pass,strto,content,0,pid);

Edit1->Text = IntToStr(rs);

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

⌨️ 快捷键说明

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