smstimer.java

来自「这是一个用jsp+Oracle开发的联系人客户关系管理系统!」· Java 代码 · 共 29 行

JAVA
29
字号
package com.ideas.communicate;

import com.ideas.alert.*;
import java.awt.event.*;
import com.ideas.util.*;

public class SMSTimer
    implements ActionListener {
//设置定时器
  javax.swing.Timer timer = new javax.swing.Timer(Configuration.PageRefreshRate, this);
  public SMSTimer() {
    if (AlertProperties.success && Configuration.SMSFlag) {
      timer.start();
      System.out.println("手机短信报警程序启动。");
    }
  }

  public void actionPerformed(ActionEvent e) {
    for (int i = 0; i < Alert.HtmlContent.length; i++) {
      String sms = Alert.HtmlContent[i];
      if (sms != null) {
        new SMSTeller().sendSMS(Configuration.SMSGatewayIP, Configuration.SMSGatewayPort,
                      Configuration.SMSPhoneNumber, sms);
      }
    }

  }
}

⌨️ 快捷键说明

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