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

📄 unit3.pas

📁 利用delphi编写的手机短信发送程序
💻 PAS
字号:
unit Unit3;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, inifiles;

type
  TForm3 = class(TForm)
    Button1: TButton;
    Button2: TButton;
    GroupBox1: TGroupBox;
    ComboBox3: TComboBox;
    Label2: TLabel;
    ComboBox2: TComboBox;
    Label3: TLabel;
    Label1: TLabel;
    Edit1: TEdit;
    procedure Button1Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form3: TForm3;
  inif : Tinifile;

implementation

{$R *.dfm}

procedure TForm3.Button1Click(Sender: TObject);
var
  s , s1 :string;
begin
  s :=  application.ExeName ;
  s := copy ( s, 1,  Length(s) - 7 );
  s1 := s + 'sms0.ini';

  inif := Tinifile.Create( s1 );
  inif.WriteInteger ( 'sms0', 'port', strtoint(self.ComboBox3.Text));
  inif.WriteInteger ( 'sms0', 'baud', strtoint(self.ComboBox2.Text));
  inif.WriteInteger ( 'sms0', 'trys', strtoint (self.Edit1.Text));
  inif.UpdateFile ;
  inif.Destroy ;
  self.close;
end;

procedure TForm3.FormCreate(Sender: TObject);
var
  s , s1 :string;
begin
  s :=  application.ExeName ;
  s := copy ( s, 1,  Length(s) - 7 );
  s1 := s + 'sms0.ini';

  inif := Tinifile.Create( s1 );
  self.ComboBox3.Text := inttostr (inif.readInteger ( 'sms0', 'port', 1));
  self.ComboBox2.Text := inttostr (inif.readInteger ( 'sms0', 'baud', 19200));
  self.Edit1.Text := inttostr (inif.readInteger ( 'sms0', 'trys', 3));
  inif.Destroy ;
end;

procedure TForm3.Button2Click(Sender: TObject);
begin
  self.Close ;
end;

end.

⌨️ 快捷键说明

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