bbtnSend: TBitBtn;
GroupBox2: TGroupBox;
mesText: TMemo;
StatusPanel: TPanel;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure bbtnSendClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure AddrBoxChange(Sender: TObject);
procedure mesTextChange(Sender: TObject);
private
{ Private declarations }
UserName:String;
MessageHeader:TStringList;
public
{ Public declarations }
end;
var
  frmSendMsg: TfrmSendMsg;
implementation
{$R *.dfm}
procedure TfrmSendMsg.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  Action:=caFree;
end;
procedure TfrmSendMsg.bbtnSendClick(Sender: TObject);
var
 i,res:Integer;
begin
  if AddrBox.Text<>'' then
   begin
     StatusPanel.Font.Color:=clBlack;
     StatusPanel.Caption:='请稍等......';
     Update;
     if AddrBox.Items.IndexOf(AddrBox.Text)=-1 then
      AddrBox.Items.Add(AddrBox.Text);
     res:=SendMsg(AddrBox.Text,'',MessageHeader.Text+mesText.Text);
     //ShowMessage(IntToStr(res));
     if res=0 then
      begin
       frmSendMsg.StatusPanel.Caption:='消息已成功送出';
       frmSendMsg.StatusPanel.Font.Color:=clBlue;
      end;
     try
      if res=87 then
      begin
       frmSendMsg.StatusPanel.Caption:='指定参数错误';
       frmSendMsg.StatusPanel.Font.Color:=clRed;
      end;
     except
       //ShowMessage('指定参数错误');
     end;
      try
       if res=2273 then
       begin
        frmSendMsg.StatusPanel.Caption:='不能找到该IP:'+AddrBox.Text;
        frmSendMsg.StatusPanel.Font.Color:=clRed;
       end;
       // ShowMessage('不能找到该IP:'+AddrBox.Text);
      except
      end;
      try
        if (res<>0)and(res<>87)and(res<>2273) then
       begin
        frmSendMsg.StatusPanel.Caption:='错误:'+IntToStr(res);
        frmSendMsg.StatusPanel.Font.Color:=clRed;
  &n
首页 上一页 6 7 8 9 10 11 12 下一页 尾页 9/15/15
delphi+sql办公自动化系统(+开题报告源程序+论文正文+外文翻译+答辩ppt)(九)由免费论文网(www.jaoyuw.com)会员上传。

