- 博客(0)
- 资源 (2)
- 收藏
- 关注
java基础教程强烈推荐
Java基础教程在20世纪70年代末和80年代初,C成为了主流的计算机编程语言,至今仍被广泛使用。
你也许会问,既然C是一种成功且有用的语言,为什么还需要新的计算机语言?答案是复
杂性(complexity)。程序越来越复杂这一事实贯穿编程语言的历史。C++正是适应了这一
需求。下面介绍为什么对程序复杂性的更好管理是C++产生的基本条件。
2010-03-06
Java 免费给手机发飞信
首先进入这个地址去下一个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了。
2009-09-08
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人