/**
*获取本地ip
*@return
*/
privateStringgetLocalIpAddress(){
try{
Stringipv4=null;
List<NetworkInterface>nilist=Collections.list(NetworkInterface.getNetworkInterfaces());
for(NetworkInterfaceni:nilist){
List<InetAddress>iali..
分类:
移动开发 时间:
2014-09-18 16:47:14
阅读次数:
205
测试可以了,做个笔记 系统是centos 6.31,直接命令 crontab -e编辑文件,里面写时间和你想要执行的命令。例子*/1 * * * * sh /home/guanliyang/try.sh#上面是每一分钟执行下 try.sh文件,测试成功。0 1 * * * sh /home/guan...
分类:
系统相关 时间:
2014-09-18 16:19:34
阅读次数:
205
public static string Obj2Json(T data) { try { System.Runtime.Serialization.Json.DataContractJsonSe...
分类:
Web程序 时间:
2014-09-18 16:02:04
阅读次数:
195
最近做一个功能,使用了struts2,input标签里的内容是和后台的实体类内容相对应,提交方法时,无法进入action的方法并且程序也不报错,检查N遍方法都没有发现,最终查找发现,是input标签传递了一个String类型的字符串,但是后台的实体类定义的却是int,导致Action请求不走。仔细分析了一下原因是Struts2已经把这些封装起来,有错误,但是他已经catch住,因此不抛错,导致你无...
分类:
其他好文 时间:
2014-09-18 11:27:13
阅读次数:
173
一 . 使用Excel对象模型创建Excel文档: 1.创建简单的文档 1 try 2 { 3 //创建Excel程序对象 4 Microsoft.Office.Interop.Excel.Application excel = new Microsoft.Office.I...
分类:
Web程序 时间:
2014-09-18 09:44:03
阅读次数:
203
#include #include #include #include using namespace std;//对于不同的异常可以采取不同的catch块进行捕捉int main(int argc, const char *argv[]){ try { int i; ...
分类:
编程语言 时间:
2014-09-18 00:47:13
阅读次数:
244
使用try和catch并finally关键字,再次主要记录一下有些比较特别的异常处理。示例: 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using S...
分类:
其他好文 时间:
2014-09-17 23:15:42
阅读次数:
364
1.the use of 'with open... as ...'2.the use of pickle(dump and load)for Step1:the 'with open ... as...' is the short format of 'try...except...finally...
分类:
编程语言 时间:
2014-09-17 23:13:52
阅读次数:
259
一坨js代码: 1 function s_gi(un, pg, ss) { 2 var c = "s.version='H.26';s.an=s_an;s.logDebug=function(m){var s=this,tcf=new Function('var e;try{console....
分类:
Web程序 时间:
2014-09-17 20:22:52
阅读次数:
500