- 浏览: 88856 次
- 性别:
- 来自: 烟台
最新评论
-
daxiaoli123:
1 http://sourceforge.net/projec ...
GCJ让Java程序脱离jre执行 -
zhangtongysu:
楼主 ,那个下载 怎么回事啊。
利用Ant和Eclipse有效地提高部署工作效率
package com.etonenet.iiie.sdk;
import java.sql.Timestamp;
import java.util.LinkedList;
/**
*Feb 20, 2007
* Zhou JianGuo
* 小白
* 中国电信上海技术研究院
* MSN:zhuojianguo_leo@hotmail.com
*/
public abstract class Sender {
protected int status = -1;
protected String desc = null;
protected String messageId = null;
protected String user = null;
protected String password = null;
protected String serviceType = null;
protected String payer = null;
protected Timestamp time = null;
protected int esmClass = 0;
protected int protocolId = 0;
protected byte[] sm = null;
protected int dataCoding = 0;
protected String url = null;
protected int priorityFlag = 1;
protected boolean debug = true;
public boolean smc = false;
public void setDebug(boolean value) {
debug = value;
}
public void setURL(String url) {
this.url = url;
}
public String getURL() {
return url;
}
public void setProtocolId(int id) {
protocolId = id;
}
public int getProtocolId() {
return protocolId;
}
public void setShortMessage(byte[] sm, int dataCoding, int esmClass, int protocolId) {
this.sm = sm;
this.dataCoding = dataCoding;
this.esmClass = esmClass;
this.protocolId = protocolId;
}
/**
* Set service type.
*
* @param serviceType service type, default null.
*/
public void setServiceType(String serviceType) {
this.serviceType = serviceType;
}
public void setSmc(boolean v) {
smc = v;
}
public boolean getSmc() {
return smc;
}
/**
* Send sms send time.
*
* @param time timstamp, string format "yyyy-MM-dd HH:mm:ss"
*/
public void setTime(Timestamp time) {
this.time = time;
}
public Timestamp getTime() {
return time;
}
/**
* Set the user.
*
* @param user the user name.
*/
public void setUser(String user) {
this.user = user;
}
public String getUser() { return user; }
/**
* Set the password of this user. if the length of password large 32. it will trim to 32.
*
* @param password user password.
*/
public void setPassword(String password) {
if (password == null) {
this.password = "";
} else {
if (password.length() > 32) {
this.password = password.substring(0, 32);
} else {
this.password = password;
}
}
}
public String getPassword() {
return password;
}
/**
* Set fee information
*
* @param payer default null. must at international format.
*/
public void setPayer(String payer) {
this.payer = payer;
}
public String getPayer() {
return payer;
}
public void setPriorityFlag(int pf) {
priorityFlag = pf;
}
public int getPriorityFlag() {
return priorityFlag;
}
/**
* Get last post status.
*/
public int getStatus() {
return status;
}
public String getDescription() {
return desc;
}
public String getMessageId() {
return messageId;
}
/**
* Send sms to special addr through etonenet sms server.
*
* @param addr target phone number
*/
public abstract int send(String addr) throws Exception;
static char baseTable[] = {
'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P',
'Q','R','S','T','U','V','W','X','Y','Z','a','b','c','d','e','f',
'g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v',
'w','x','y','z','0','1','2','3','4','5','6','7','8','9','+','/'
};
public static void base64(byte[] arr, StringBuffer sb) {
byte bytes[] = arr;
int n = arr != null ? arr.length : 0;
if (n < 1) return; // no bytes to encode!?!
byte buf[] = new byte[4]; // array of base64 characters
int n3byt = n / 3; // how 3 bytes groups?
int nrest = n % 3; // the remaining bytes from the grouping
int k = n3byt * 3; // we are doing 3 bytes at a time
int linelength = 0; // current linelength
int i = 0; // index
// do the 3-bytes groups ...
while ( i < k ) {
buf[0]= (byte)((bytes[i] & 0xFC) >> 2);
buf[1]= (byte)(((bytes[i] & 0x03) << 4)|((bytes[i+1] & 0xF0)>> 4));
buf[2]= (byte)(((bytes[i+1] & 0x0F)<< 2)|((bytes[i+2] & 0xC0)>> 6));
buf[3]= (byte)(bytes[i+2] & 0x3F);
sb.append(baseTable[buf[0]]);
sb.append(baseTable[buf[1]]);
sb.append(baseTable[buf[2]]);
sb.append(baseTable[buf[3]]);
i += 3;
}
// deals with with the padding ...
if (nrest==2) {
// 2 bytes left
buf[0] = (byte)(( bytes[k] & 0xFC) >> 2);
buf[1] = (byte)(((bytes[k] & 0x03) << 4) |
((bytes[k+1] & 0xF0) >> 4));
buf[2] = (byte)(( bytes[k+1] & 0x0F) << 2);
}
else if (nrest==1) {
// 1 byte left
buf[0] = (byte)((bytes[k] & 0xFC) >> 2);
buf[1] = (byte)((bytes[k] & 0x03) << 4);
}
if (nrest > 0) {
// send the padding
sb.append(baseTable[buf[0]]);
sb.append(baseTable[buf[1]]);
// Thanks to R. Claerman for the bug fix here!
if (nrest==2) {
sb.append(baseTable[buf[2]]);
}
else {
sb.append('=');
}
sb.append('=');
}
}
/**
* Send(group send) message to multi phones.
*
* @param list phone number list
*/
public void send(LinkedList list) throws Exception {
for(int i = 0; i < list.size(); i ++) {
String s = (String)list.get(i);
send(s);
}
}
}
import java.sql.Timestamp;
import java.util.LinkedList;
/**
*Feb 20, 2007
* Zhou JianGuo
* 小白
* 中国电信上海技术研究院
* MSN:zhuojianguo_leo@hotmail.com
*/
public abstract class Sender {
protected int status = -1;
protected String desc = null;
protected String messageId = null;
protected String user = null;
protected String password = null;
protected String serviceType = null;
protected String payer = null;
protected Timestamp time = null;
protected int esmClass = 0;
protected int protocolId = 0;
protected byte[] sm = null;
protected int dataCoding = 0;
protected String url = null;
protected int priorityFlag = 1;
protected boolean debug = true;
public boolean smc = false;
public void setDebug(boolean value) {
debug = value;
}
public void setURL(String url) {
this.url = url;
}
public String getURL() {
return url;
}
public void setProtocolId(int id) {
protocolId = id;
}
public int getProtocolId() {
return protocolId;
}
public void setShortMessage(byte[] sm, int dataCoding, int esmClass, int protocolId) {
this.sm = sm;
this.dataCoding = dataCoding;
this.esmClass = esmClass;
this.protocolId = protocolId;
}
/**
* Set service type.
*
* @param serviceType service type, default null.
*/
public void setServiceType(String serviceType) {
this.serviceType = serviceType;
}
public void setSmc(boolean v) {
smc = v;
}
public boolean getSmc() {
return smc;
}
/**
* Send sms send time.
*
* @param time timstamp, string format "yyyy-MM-dd HH:mm:ss"
*/
public void setTime(Timestamp time) {
this.time = time;
}
public Timestamp getTime() {
return time;
}
/**
* Set the user.
*
* @param user the user name.
*/
public void setUser(String user) {
this.user = user;
}
public String getUser() { return user; }
/**
* Set the password of this user. if the length of password large 32. it will trim to 32.
*
* @param password user password.
*/
public void setPassword(String password) {
if (password == null) {
this.password = "";
} else {
if (password.length() > 32) {
this.password = password.substring(0, 32);
} else {
this.password = password;
}
}
}
public String getPassword() {
return password;
}
/**
* Set fee information
*
* @param payer default null. must at international format.
*/
public void setPayer(String payer) {
this.payer = payer;
}
public String getPayer() {
return payer;
}
public void setPriorityFlag(int pf) {
priorityFlag = pf;
}
public int getPriorityFlag() {
return priorityFlag;
}
/**
* Get last post status.
*/
public int getStatus() {
return status;
}
public String getDescription() {
return desc;
}
public String getMessageId() {
return messageId;
}
/**
* Send sms to special addr through etonenet sms server.
*
* @param addr target phone number
*/
public abstract int send(String addr) throws Exception;
static char baseTable[] = {
'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P',
'Q','R','S','T','U','V','W','X','Y','Z','a','b','c','d','e','f',
'g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v',
'w','x','y','z','0','1','2','3','4','5','6','7','8','9','+','/'
};
public static void base64(byte[] arr, StringBuffer sb) {
byte bytes[] = arr;
int n = arr != null ? arr.length : 0;
if (n < 1) return; // no bytes to encode!?!
byte buf[] = new byte[4]; // array of base64 characters
int n3byt = n / 3; // how 3 bytes groups?
int nrest = n % 3; // the remaining bytes from the grouping
int k = n3byt * 3; // we are doing 3 bytes at a time
int linelength = 0; // current linelength
int i = 0; // index
// do the 3-bytes groups ...
while ( i < k ) {
buf[0]= (byte)((bytes[i] & 0xFC) >> 2);
buf[1]= (byte)(((bytes[i] & 0x03) << 4)|((bytes[i+1] & 0xF0)>> 4));
buf[2]= (byte)(((bytes[i+1] & 0x0F)<< 2)|((bytes[i+2] & 0xC0)>> 6));
buf[3]= (byte)(bytes[i+2] & 0x3F);
sb.append(baseTable[buf[0]]);
sb.append(baseTable[buf[1]]);
sb.append(baseTable[buf[2]]);
sb.append(baseTable[buf[3]]);
i += 3;
}
// deals with with the padding ...
if (nrest==2) {
// 2 bytes left
buf[0] = (byte)(( bytes[k] & 0xFC) >> 2);
buf[1] = (byte)(((bytes[k] & 0x03) << 4) |
((bytes[k+1] & 0xF0) >> 4));
buf[2] = (byte)(( bytes[k+1] & 0x0F) << 2);
}
else if (nrest==1) {
// 1 byte left
buf[0] = (byte)((bytes[k] & 0xFC) >> 2);
buf[1] = (byte)((bytes[k] & 0x03) << 4);
}
if (nrest > 0) {
// send the padding
sb.append(baseTable[buf[0]]);
sb.append(baseTable[buf[1]]);
// Thanks to R. Claerman for the bug fix here!
if (nrest==2) {
sb.append(baseTable[buf[2]]);
}
else {
sb.append('=');
}
sb.append('=');
}
}
/**
* Send(group send) message to multi phones.
*
* @param list phone number list
*/
public void send(LinkedList list) throws Exception {
for(int i = 0; i < list.size(); i ++) {
String s = (String)list.get(i);
send(s);
}
}
}
发表评论
-
调试MAVEN项目appfuse-light-struts2-spring-jdbc-1.8的问题
2008-03-07 16:31 2251出现问题: Project appfuse-light-str ... -
MVC设计思想
2008-03-01 22:13 2104MVC英文即Model-View-Controll ... -
当前Java软件开发中几种认识误区(转)
2008-03-01 22:11 933软件的生命性 软件是有生命的,这可能是老调重弹了,但是因 ... -
给servlet写单元测试的总结(转)
2008-02-19 11:19 3514servlet的测试一般来说需要容器的支持,不是像通常的jav ... -
取得参数的几中形式
2008-02-18 12:54 857java -DSTOP.PORT=8080 -DSTOP.KE ... -
正则表达式
2008-02-18 12:34 874目录 本文目标 如何使 ... -
关于Java中类在构造对象时的初始化步骤详解
2008-02-18 12:17 2063很多人在学习Java的过程 ... -
Java连接各种数据库的实例
2008-02-18 12:13 1133一、jsp连接Oracle8/8i/9i数据库(用thin模式 ... -
为什么要使用接口编程(转)
2008-02-17 21:42 1254看了接口编程这篇文章, ... -
JAVA中浅复制与深复制
2008-02-17 21:38 6941.浅复制与深复制概念 ⑴浅复制(浅克隆) 被复制对象的所有变 ... -
appfuse结合eclipse开发流程
2008-02-17 21:33 1186Appfuse应用的核心在于ant ... -
使用Antlr和JfreeChart实现项目源代码行数计算图表
2008-02-17 21:30 1502Antlr的功能在我的其他文章里提到了就不多说了,JFreeC ... -
使用ANT协助开发java项目
2008-02-17 21:29 865ANT是Apache的开源项目,目前在java的项目开发中被广 ... -
利用Ant和Eclipse有效地提高部署工作效率
2008-02-17 21:26 1239本文主要介绍 Ant 在多 ... -
使用开源软件 Mantis 实施缺陷跟踪的成功实践
2008-02-17 21:22 1670内容摘要 中国开源 注:当前Mantis稳定发布版本为1.0. ... -
开源缺陷跟踪系统mantis安装指南
2008-02-17 21:14 18431. 简介 mantis(螳螂)是一个基于php/MySQL/ ... -
无所不能的“蚂蚁”-Ant(转)
2008-02-17 21:12 3204说他无所不能,好像有点夸张,但是用过Ant之后,感觉真的是只有 ... -
Java华为面试题
2008-02-17 21:08 1437第一部分:选择题 QUESTION NO: 1 1、publi ... -
java中读取Properties文件
2008-02-17 21:06 881ResourceBundle resourceBundle = ... -
Java范型
2008-02-17 21:04 1512从jdk1.5开始,Java中开始 ...
相关推荐
短信网关接口集成 各种语言源代码集成应用 asp php asp.net c# 等接口源码 跟实与网站 集成。验证码发送。短信收发功能。
短信网关接口源代码:口标准:客户端通过Tcp连接到服务器(211.162.36.89:8021, IP可能会变动,变动时,以www.pohoo.com网站公布的为准)。连接成功后客户端应首先发送注册串为:Login Name=【注册名】&Pwd=【注册...
这里不但为你提供短信网关信息,同时还提供短信网关源代码及其开发资料,通过Internet网连接到短信网关服务的端口即可,源代码包括短信协议,短信发送及其DEMO程序。有了开发源代码及其开发资料,你可以按自己的要求...
逢年过节,总要群发一些祝福短信之类的给客户、朋友。使用手机群发太慢,成本还高。要是有几千几万的客户的话...无论今天的免费午餐还能吃多久,我们不妨来试试下面这些免费的手机短信发送方法、愿它能带给你一些实惠。
c#调用傲天api实现向联通短信网关发送短信,接收状态报告等功能,包内包括傲天api和vs2005下的c#源代码。
SendSMS利用新浪短信网关发送短信的程序和源代码。其实就是操作网页提交来达到发送效果。
电信短信网关发送部分源代码:public abstract class Sender
短信网关发送源代码,包含对短信网关的使用和发送有一定的帮助
1.遵照CMPP3.0协议实现,模拟了短信网关,支持CONNECT,SUBMIT,DELIVER,QUERY,CANCEL,TERMINATE消息; 2.net5.0开发支持windows/liunx系统; 3.支持长短信; 4.支持心跳协议; 5.支持多线程; 6.支持收/发短信; 7....
短信网关源代码,可以发送短消息,有需要可以
▲ 内置各大网站高速短信网关,发送每条短信不超过5秒。 ▲ 支持自编短语库,方便调用。 ▲ 支持短信群发功能,可任意批量生成手机号码。 ▲ 提供了各大短信网站的言情短语库,短语多而且种类齐,不管你...
北信正通电信级短信平台MC-SMS在通讯模块、数据接受和发送模块、数据处理模块等方面据具有强大的海量处理能力。平台支持现行运营商的所有短信通信协议(包括Cmpp3.0、Cmpp2.0、Sgip1.2、Sgip2.0、Isag\Ismp以及其他...
中国移动长短信接收发送的网关系统工程源程序代码
该短信平台适用于大中小型企业、商场、酒店等,面向企事业单位...主要提供短信网关,短信接口, 网站接口以及 OA 、 CRM 、 ERP 、 SCM 、等系统及B2B大型网站平台使用。 接入方式可灵活使用,24小时发送,多条通道备用。
2个目标文件 摘要:Java源码,文件操作,TCP,服务器 Tcp服务端与客户端的JAVA实例源代码,一个简单的Java TCP服务器端程序,别外还有一个客户端的程序,两者互相配合可以开发出超多的网络程序,这是最基础的部分。...
通过ICQ网关发送手机短信的php源程序复制代码 代码如下:<?//###########################################################//// For questions and comments// Roland (alias -=: Vlieg :=-)// icq #78354631// ...