随笔分类 -  java

摘要:import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.RandomAccessFile; /** * 文件加密、解密 * */ public class FileJiamiTest { /** * 文件file进行加密 * @par... 阅读全文
posted @ 2014-01-04 13:42 NúllPòinterExcêptīon 阅读(901) 评论(0) 推荐(0)
摘要://将str1替换为str1 //FilePath为文件路径 public void changeTxtContent(String FilePath,String str1,String str2) throws Exception{ File file = new File(FilePath); String code = getFileCharacterEnding(file);//获取文件编码 InputStreamReader read = new InputStreamReader(new FileInputStream( ... 阅读全文
posted @ 2013-12-25 10:44 NúllPòinterExcêptīon 阅读(1358) 评论(0) 推荐(0)
摘要:URL url = this.getClass().getResource("/images/01.jpg");Image img = Toolkit.getDefaultToolkit().getImage(url);this.setIconImage(img); 阅读全文
posted @ 2013-12-23 14:26 NúllPòinterExcêptīon 阅读(742) 评论(0) 推荐(0)
摘要:1、首先准备我们的资源,把要转换的Jar文件、精简过的JRE文件夹和想生成的EXE文件的图标(可以是png,jpg等格式,不想加图标可以不弄)放到同一个文件夹内。这一步一定要做,否则可以成功生成,但在没有java环境的机子上还是不能运行,因为他会找不到JRE文件夹的位置 2、双击jsmoothgen.exe,出现主界面。 3、点击骨架,我从骨架中选择Windows Wrapper(根据自己... 阅读全文
posted @ 2013-12-23 12:47 NúllPòinterExcêptīon 阅读(2973) 评论(0) 推荐(0)
摘要:public void CopyFile(String FilePath,String outFilePath){ try { FileInputStream fi = new FileInputStream(FilePath); BufferedInputStream in = new BufferedInputStream(fi); FileOutputStream fo = new FileOutputStream(outFilePath); BufferedOutputStream out = new BufferedOutputStream(fo); by... 阅读全文
posted @ 2013-12-19 16:10 NúllPòinterExcêptīon 阅读(158) 评论(0) 推荐(0)
摘要:String str= "Forevercai;http://4evercai.com;2"; String [] strS = str.split(";"); for (int i = 0; i < strS.length; i++) { System.out.println(strS[i]); } 阅读全文
posted @ 2013-12-19 09:59 NúllPòinterExcêptīon 阅读(452) 评论(0) 推荐(0)
摘要:1 public static String getFileCharacterEnding(File file) throws Exception { 2 InputStream inputStream = new FileInputStream(file); 3 byte[] head = new byte[3]; 4 inputStream.read(head); 5 String code = "gbk"; 6 if (head[0] == -1 && head[1] == -2){ 7 ... 阅读全文
posted @ 2013-12-19 09:55 NúllPòinterExcêptīon 阅读(1641) 评论(0) 推荐(0)