如何copy一个文件到指定目录中 String soure = "c:\\temp.txt";String targe = " d:\\";Runtime.getRuntime().exec("cmd /c copy "+ soure + targe); 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 hoho, a good method :) try{ FileReader in=new FileReader(new File("in.txt")); FileWriter out=new FileWriter(new File("out.txt")); int c; while((c=in.read())!=-1) out.write(c);}catch(IOException e){ e.printStackTrace();}finally{ if(in!=null) try{ in.close();}catch(IOException e){} if(out!=null) try{ out.close();}catch(IOException e){}} 求助:关于eclipse的一个小问题 socket的问题 菜鸟提问 java applet嵌入到浏览器中 输出格式 求教:基于java的类似QQ的聊天系统 这样比较判断两个byte型的是否相等? 再问一个更刁钻的问题:怎样限制jTabel中某一个列(字段)只能输入数字,而不是字母呢? 怎样调整Java的环境变量? 如何用程序控制JTree中节点的选择。 java可以调用windows api吗,用jbuild 可以生成.exe文件吗,散分,高手出招 在JB8中使用JSPLITPANE的布局问题 对CSDN关于修改密码的建议一点点,尽管CSDN对我进行了信誉上的剥夺
{
FileReader in=new FileReader(new File("in.txt"));
FileWriter out=new FileWriter(new File("out.txt"));
int c;
while((c=in.read())!=-1) out.write(c);
}
catch(IOException e)
{
e.printStackTrace();
}
finally
{
if(in!=null)
try{ in.close();}catch(IOException e){}
if(out!=null)
try{ out.close();}catch(IOException e){}
}