文件名称:SMS扩展配置.rar
-
所属分类:
- 标签属性:
- 上传时间:2009-01-03
-
文件大小:1015.8kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
1、将jre文件夹复制到你本机所在的JDK下覆盖掉全部jre文件夹
2、将lib文件夹复制到你项目所在的lib,添加对应lib
import org.smslib.IOutboundMessageNotification;
import org.smslib.Library;
import org.smslib.MessageEncodings;
import org.smslib.MessageProtocols;
import org.smslib.OutboundMessage;
import org.smslib.Service;
import org.smslib.modem.SerialModemGateway;
import java.util.List;
public class SendSms {
public SendSms() {
}
public void sendSMS(String[] phoneNumber) throws Exception {
Service srv;
OutboundMessage msg;
OutboundNotification outboundNotification = new OutboundNotification();
srv = new Service();
SerialModemGateway gateway = new SerialModemGateway("modem.com1",
"COM1", 9600, null, null);
gateway.setInbound(true);
gateway.setOutbound(true);
gateway.setSimPin("0000");
gateway.setOutboundNotification(outboundNotification);
gateway.setProtocol(MessageProtocols.PDU);
srv.addGateway(gateway);
try {
srv.startService();
for (int i = 0; i < phoneNumber.length; i++) {
msg = new OutboundMessage(phoneNumber[i], "您有会议待处理,请登陆查看!");
msg.setEncoding(MessageEncodings.ENCUCS2);
srv.sendMessage(msg);
}
} finally {
srv.stopService();
}
}
public class OutboundNotification implements IOutboundMessageNotification {
public void process(String gatewayId, OutboundMessage msg) {
System.out.println("Outbound handler called from Gateway: " +
gatewayId);
System.out.println(msg);
}
}
public static void main(String args[]) {
SendSms app = new SendSms();
try {
app.doIt();
} catch (Exception e) {
e.printStackTrace();
}
}
}
2、将lib文件夹复制到你项目所在的lib,添加对应lib
import org.smslib.IOutboundMessageNotification;
import org.smslib.Library;
import org.smslib.MessageEncodings;
import org.smslib.MessageProtocols;
import org.smslib.OutboundMessage;
import org.smslib.Service;
import org.smslib.modem.SerialModemGateway;
import java.util.List;
public class SendSms {
public SendSms() {
}
public void sendSMS(String[] phoneNumber) throws Exception {
Service srv;
OutboundMessage msg;
OutboundNotification outboundNotification = new OutboundNotification();
srv = new Service();
SerialModemGateway gateway = new SerialModemGateway("modem.com1",
"COM1", 9600, null, null);
gateway.setInbound(true);
gateway.setOutbound(true);
gateway.setSimPin("0000");
gateway.setOutboundNotification(outboundNotification);
gateway.setProtocol(MessageProtocols.PDU);
srv.addGateway(gateway);
try {
srv.startService();
for (int i = 0; i < phoneNumber.length; i++) {
msg = new OutboundMessage(phoneNumber[i], "您有会议待处理,请登陆查看!");
msg.setEncoding(MessageEncodings.ENCUCS2);
srv.sendMessage(msg);
}
} finally {
srv.stopService();
}
}
public class OutboundNotification implements IOutboundMessageNotification {
public void process(String gatewayId, OutboundMessage msg) {
System.out.println("Outbound handler called from Gateway: " +
gatewayId);
System.out.println(msg);
}
}
public static void main(String args[]) {
SendSms app = new SendSms();
try {
app.doIt();
} catch (Exception e) {
e.printStackTrace();
}
}
}
(系统自动生成,下载前可以参看下载内容)
下载文件列表
压缩包 : SMS扩展配置.rar 列表 SMS扩展配置\jre\lib\javax.comm.properties SMS扩展配置\jre\lib\ext\comm.jar SMS扩展配置\jre\bin\win32com.dll SMS扩展配置\lib\commons-net-1.4.1.jar SMS扩展配置\lib\log4j-1.2.15.jar SMS扩展配置\lib\mail.jar SMS扩展配置\lib\smslib-3.2.2.jar SMS扩展配置\配置方式.txt SMS扩展配置\SendSms.java SMS扩展配置\jre\lib\ext SMS扩展配置\jre\lib SMS扩展配置\jre\bin SMS扩展配置\jre SMS扩展配置\lib SMS扩展配置
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.