; if ((leftstr(s,6)='003100')) or ((leftstr(s,6)='005100') and (midstr(s,39,2)=midstr(s,41,2))) then begin ADOCommandvar_input.CommandText:='insert into sendSMS(senddate, sendto, sendSMS) values(:senddate, :sendto, :sendSMS)'; ADOCommandvar_input.Parameters[0].Value:=FormatDateTime('YYYY-mm-dd HH:mm:ss',now()); ADOCommandvar_input.Parameters.Value:=unExchangeCode(midstr(s,11,12)); ADOCommandvar_input.Parameters.Value:=sendSMSstr; ADOCommandvar_input.Execute; end; end;end; //监测com口 procedure Tmainform.Comm1ReceiveData(Sender: TObject; Buffer: Pointer; BufferLength: Word);var i,j,k,sendtimes:integer; sBuffer,SendData, s,s1,s2: string;userinfo:TIniFile;begin userinfo:=TIniFile.Create(ExtractFilePath(ParamStr(0))+'comlog.ini'); sBuffer := ''; SetLength(sBuffer, BufferLength); StrLCopy(PChar(sBuffer), Buffer, BufferLength); s := ''; for i := 0 to BufferLength div 2 do Copy(sBuffer, i * 2 + 1, 2); j:= HexToInt('content#39; +sBuffer ); s := s +sBuffer ; bsSkinMemo4.lines.add(s); if (pos('OK',s)>0) or (pos('>',s)>0) then begin if bsSkinListBox1.Items.Count>0 then Timer2.Enabled:=true; end; end; //采用两个计时器循环完成多人发送 procedure Tmainform.Timer1Timer(Sender: TObject);vari,k:integer;phonenum:string;begin//准备发送内容sendSMSstr:='';bsSkinListBox1.Items.Clear;bsSkinButton34.Enabled:=false; for i:=0 to bsSkinMemo3.lines.count-1 do begin sendSMSstr:=sendSMSstr+self.bsSkinMemo3.Lines[i]; end;if bsSkinCheckRadioBox1.Checked then //发送第一个选择的用户 begin k:=0; for i:=0 to bsSkinCheckListBox1.Items.Count - 1 do begin if bsSkinCheckListBox1.Checked[i] then begin try phonenum:=bsSkinCheckListBox1.Items[i]; &