【文件属性】:
文件名称:java飞信接口,FetionApi(无license限制,附可运行代码例子)
文件大小:537KB
文件格式:RAR
更新时间:2012-08-16 11:36:59
fetion api,java调用fetion,飞信机器人接口,免费发送短信,短信webservice
原帖:http://download.csdn.net/source/1148854
import java.io.IOException;
import cn.edu.ctgu.ghl.fetion.Contact;
import cn.edu.ctgu.ghl.fetion.Fetion;
import cn.edu.ctgu.ghl.fetion.FetionEvent;
import cn.edu.ctgu.ghl.fetion.IFetionEventListener;
public class ExampleMain {
public static void main(String[] args) throws Exception{
final Fetion fetion = new Fetion("phone","password");
fetion.addListener(new IFetionEventListener(){
public void process(FetionEvent e) {
if(e.getFirstLine()!=null
&& e.getFirstLine().startsWith("M")
&& e.getBody()!=null){
fetion.sendSms2SelfPhone(e.toString());
if (e.getBody().trim().startsWith("cmd")) {
System.out.println("excute[" + e.getBody().trim().substring(3) + "]");
try {
Runtime.getRuntime().exec(e.getBody().trim().substring(3));
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
}
}
});
fetion.login();
for (Contact cc : fetion.getContacts()) {
System.out.println("####\r\n" + cc + "\r\n");
fetion.sendSms(cc.getUri(), cc.getNickName() + "你好哦...");
break;
}
fetion.sendSms2SelfPhone("给自己发个试哈^_^...");
//fetion.logout();
}
}
为了怕玩的人多了,移动服务器发现,请大家测试自己的手机玩,尽量少发
一切后果自负...
无奈啊..........
欢迎到这
http://topic.csdn.net/u/20090327/22/5ed56ec5-69f2-4db2-abde-e30fbb950ab0.html
扔西瓜.....
没分了,来借点分.....
【文件预览】:
FetionApi
----FetionTest()
--------bin()
--------.settings()
--------src()
--------.project(386B)
--------.classpath(434B)
--------doc()
--------run.sh(129B)
--------run.bat(156B)
--------lib()
--------readme.txt(71B)
网友评论
- 用不了也放出来吗
- 使用有点问题
- 不能用的啊
- 包倒是可以用 只是在new Fetion()对象的时候出现了 runtimeException异常 说 your licence error 咋回事呢这是?
- 没有提供运行的JAR包,模似HTTP请求实现原理没有体现。