@@ -0,0 +1,2455 @@
+/**%0A * Alipay.com Inc.%0A * Copyright (c) 2004-2013 All Rights Reserved.%0A */%0Apackage com.atom.crwal;%0A%0Aimport java.io.BufferedInputStream;%0Aimport java.io.File;%0Aimport java.io.FileOutputStream;%0Aimport java.io.InputStream;%0Aimport java.io.OutputStream;%0Aimport java.util.Date;%0Aimport java.util.Timer;%0Aimport java.util.TimerTask;%0A%0Aimport org.apache.commons.io.FileUtils;%0Aimport org.apache.commons.io.FilenameUtils;%0Aimport org.apache.commons.io.IOUtils;%0A%0Aimport com.atom.core.lang.utils.DateUtils;%0A%0A/**%0A * %E7%BD%91%E7%BB%9CIP%E4%BF%A1%E6%81%AF%0A * %0A * @author shizihu%0A * @version $Id: IPNetMain.java, v 0.1 2013-9-14 %E4%B8%8B%E5%8D%8804:05:20 shizihu Exp $%0A */%0Apublic class IPNetMain %7B%0A%0A    /**%0A     * %E5%AE%9A%E6%97%B6%E6%8A%8AIP%E4%BF%A1%E6%81%AF%E5%86%99%E5%85%A5%E6%96%87%E4%BB%B6%E4%B8%AD%0A     */%0A    public static void main(String%5B%5D args) %7B%0A        Date now = new Date();%0A        Timer timer = new Timer(%22IPNetMain%22, true);%0A%0A        // 1%E4%B8%AA%E5%B0%8F%E6%97%B6%E6%A3%80%E6%9F%A5%E4%B8%80%E6%AC%A1%E6%98%AF%E5%90%A6%E8%BF%87%E6%9C%9F%0A        timer.schedule(new TimerTask() %7B%0A            public void run() %7B%0A                execute();%0A            %7D%0A        %7D, now, 60 * 60 * 1000);%0A%0A        // %E9%98%B2%E6%AD%A2%E7%A8%8B%E5%BA%8F%E9%80%80%E5%87%BA%0A        new Thread() %7B%0A            public void run() %7B%0A                while (true) %7B%0A                    try %7B%0A                        Thread.sleep(5 * 1000);%0A                    %7D catch (Exception e) %7B%0A                        //%0A                    %7D%0A                %7D%0A            %7D%0A        %7D.start();%0A    %7D%0A%0A    /**%0A     * %E8%8E%B7%E5%8F%96IP%E4%BF%A1%E6%81%AF%E5%B9%B6%E5%86%99%E5%85%A5%E6%96%87%E4%BB%B6%0A     */%0A    private static void execute() %7B%0A        OutputStream output = null;%0A        InputStream input = null;%0A        try %7B%0A            Process process = Runtime.getRuntime().exec(%22ipconfig /all%22);%0A%0A            String path = %22d:/Data/BDCloud/CodeSpace/ipnet%22;%0A            FileUtils.forceMkdir(new File(path));%0A%0A            String fname = DateUtils.toString(new Date(), %22yyyyMMdd-HH-mm-ss%22) + %22.txt%22;%0A            output = new FileOutputStream(new File(FilenameUtils.normalize(path + %22/%22 + fname)),%0A                true);%0A            output.write(%22+++++++++++++++++++++++++++++++++++++++++++++++++++++%5Cn%22.getBytes());%0A            output.write(DateUtils.toStringDL(new Date()).getBytes());%0A            output.write(%22%5Cn%22.getBytes());%0A            output.write(%22+++++++++++++++++++++++++++++++++++++++++++++++++++++%5Cn%22.getBytes());%0A%0A            input = new BufferedInputStream(process.getInputStream());%0A%0A            IOUtils.copy(input, output);%0A        %7D catch (Exception e) %7B%0A            e.printStackTrace();%0A        %7D finally %7B%0A            IOUtils.closeQuietly(input);%0A            IOUtils.closeQuietly(output);%0A        %7D%0A    %7D%0A%0A%7D%0A

add timer for ipnet Signed-off-by: 老牛啊 <obullxl@gmail.com>