代码示例

代码下载delphi7代码示例 在线技术支持

	procedure btnSendSmsClick(Sender: TObject);
	var
	  ParamLst: TStrings;
	  ReMsg: WideString;
	begin
	  btnSendSms.Enabled := False;
	  Screen.Cursor := crHourGlass;
	  ParamLst := TStringList.Create;
	  try
		
		if Trim(edtTel.Text) = EmptyStr then Exit;
		if Trim(mmoSmsCon.Text) = EmptyStr then Exit;

		begin
		ParamLst.Add('accName=' + Trim(edtUserName.Text));
		ParamLst.Add('accPwd=' + md5(edtPassword.Text));
		ParamLst.Add('content=' + UTF8Encode(Trim(mmoSmsCon.Text)));
		ParamLst.Add('aimcodes=' + Trim(edtTel.Text));
		ParamLst.Add('dataType' + 'string');

		ReMsg := UTF8Decode(IdHTTP.Post('http://www.lx598.com/sdk/send', ParamLst));

		mmoDisplay.Lines.Add('错误代码:' + ReMsg);

		IdHTTP.Disconnect;
		IdHTTP.Request.Clear;

		edtTel.Clear;
		mmoSmsCon.Clear;
		end
	  finally
		btnSendSms.Enabled := True;
		Screen.Cursor := crDefault;
		ParamLst.Free;
	  end;
	end;