Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Java SE 综合讨论区  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 Re:各位大哥帮忙!(找不到指定文件) [Re:whhxtt]
whhxtt





发贴: 6
积分: 0
于 2006-03-30 09:44 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
对啊,那要怎样才可以呢?我对路径是一头雾水,一点都不懂。还有我这个程序也提示错误,就是我的路径写的有问题,错误是这样的:java.lang.Error: 无法解析的编译问题:
  转义序列无效(有效的转义序列为 \b \t \n \f \r \" \' \\)

  at xinhua.net.com.SequenceIuputStreamDemo.main(SequenceIuputStreamDemo.java:38)
Exception in thread "main"

程序如下:
package xinhua.net.com;

/**
* @author Administrator
*
* TODO 要更改此生成的类型注释的模板,请转至
* 窗口 - 首选项 - Java - 代码样式 - 代码模板
*/
import java.io.*;
import java.util.*;
class InputStreamEnumerator implements Enumeration{
private Enumeration files;
public InputStreamEnumerator(Vector files){
this.files=files.elements();
}
public boolean hasMoreElements(){
return files.hasMoreElements();
}
public Object nextElement(){
try{
return new FileInputStream(files.nextElement().toString());
}
catch(Exception e){
return null;
}
}
}
public class SequenceIuputStreamDemo {
public static void main(String[]args)throws Exception{
int c;
Vector files=new Vector();
files.addElement("D:\Downloads\eclipse\workspace\jsp\file1.txt");
files.addElement("D:\Downloads\eclipse\workspace\jsp\file2.txt");
InputStreamEnumerator w=new InputStreamEnumerator(files);
InputStream input=new SequenceInputStreamWilted Rose;
while((c=input.read())!=-1){
System.out.println((char)c);
}
input.close();
}


}




话题树型展开
人气 标题 作者 字数 发贴时间
6956 各位大哥帮忙!(找不到指定文件) whhxtt 1308 2006-03-28 14:32
5880 Re:各位大哥帮忙! cargo 12 2006-03-28 15:03
5853 Re:各位大哥帮忙! whhxtt 69 2006-03-30 09:06
5850 Re:各位大哥帮忙! JavaandC 23 2006-03-28 15:11
5866 Re:各位大哥帮忙!(找不到指定文件) whhxtt 330 2006-03-30 09:04
5876 Re:各位大哥帮忙!(找不到指定文件) zcjl 463 2006-03-30 09:15
5893 Re:各位大哥帮忙!(找不到指定文件) whhxtt 1505 2006-03-30 09:44
5832 Re:各位大哥帮忙!(找不到指定文件) whhxtt 29 2006-03-30 09:47
5990 Re:各位大哥帮忙!(找不到指定文件) hoden_w 516 2006-03-30 17:38

flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923