随笔分类 -  Java

摘要://转化字符串为十六进制编码public static String toHexString(String s) { String str=""; for (int i=0;i<s.length();i++) { int ch = (int)s.charAt(i); String s4 = Integer.toHexString(ch); str = ... 阅读全文
posted @ 2010-02-02 14:24 Bon.Shi 阅读(2003) 评论(0) 推荐(0)
摘要:import org.xml.sax.InputSource;import org.xml.sax.SAXException;//导入dom4j包,可以到官网上去下载后导入import org.dom4j.DocumentException;import org.dom4j.DocumentHelper;import org.dom4j.Element;import org.w3c.dom.Doc... 阅读全文
posted @ 2010-02-02 14:17 Bon.Shi 阅读(5843) 评论(0) 推荐(1)
摘要:import rtx.RTXSvrApi;//导入RTXAPI类。public class RTXMSGDemo{ public static void main(String[] args) { String receiver = "";//接收者RTX账号 String title = "";//消息标题 String msgType = "";//消息类型,0|1,紧急或者一般 String smInfo = "";//消息内容 RTXSvrApi RtxsvrapiObj = new RTXSvrApi() 阅读全文
posted @ 2010-02-02 11:15 Bon.Shi 阅读(1658) 评论(0) 推荐(0)
摘要:import java.io.*;class ByteArrayInputStreamDemo{ String strTmp = "BonShi"; byte b[] strTmp.getBytes(); ByteArrayInputStream in = new ByteArrayInputStram(b); for(int i=0;i<2;i++){ int c;... 阅读全文
posted @ 2010-02-02 10:40 Bon.Shi 阅读(491) 评论(0) 推荐(0)
摘要:计算某一月份的最大天数 Calendar time=Calendar.getInstance(); time.clear(); time.set(Calendar.YEAR,year); time.set(Calendar.MONTH,i-1);//注意,Calendar对象默认一月为0 int day=time.getActualMaximum(Calendar.DAY_OF_MONTH);//... 阅读全文
posted @ 2010-02-02 10:34 Bon.Shi 阅读(3193) 评论(0) 推荐(0)