RandomAccessFile openfile = new RandomAccessFile( this.OpenPathFileName,"r" );
File file = new File( this.SavePathFileName + "temp" );
RandomAccessFile savefile = new RandomAccessFile( file,"rw" ); readline = openfile.readLine();
savefile.writeBytes( readline );
File file = new File( this.SavePathFileName + "temp" );
RandomAccessFile savefile = new RandomAccessFile( file,"rw" ); readline = openfile.readLine();
savefile.writeBytes( readline );
解决方案 »
- jcreator编译时提示:javac: 无效的标志
- 十万火急丫~~有没有好心人可以帮我下下~~~~
- 关于数据库的连接问题
- 外企JAVA职位面试题,有兴趣的朋友进来解答一下!
- jbuilderx开发web应用,当更新编译一类时,jbuilderx会将此更新同步到web-inf/classes下,但如果是properties或xml文件,那么如何同步了?
- 课后作业题目——很简单的!
- 一个菜鸟的问题:Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorld
- 怎样随机的从一个记录集中取出一个记录阿?
- 为什么要用htmlconverter转换applet.
- 小问题,能答者即给分
- 如何获得昨天的日期?
- 急:请问一个telnet自动登陆的问题,高分求解,不够再加分
File dir=new File("/");
Filter filter=new Filter("html");
System.out.println("list html files in directory "+dir);
String files[]=dir.list(filter);
for(int i=0;i<files.length;i++){
File f=new File(files[i]);
if(f.isFile())
System.out.println("file "+f);
else
System.out.println("sub directory "+f);
}你改改就可以用了。你建了文件名数组,然后产生随机数做数组下标,再打开文件,就可以了