我翻遍我手边的一本java书和一本jsp书了
都没有对file遍历目录的描述
能否详细点啊
我加送80分啊
都没有对file遍历目录的描述
能否详细点啊
我加送80分啊
解决方案 »
- java程序报错
- 一个很奇怪的错误(刚从公司导回的项目运行不了)
- 请高手指点一个奇怪问题,头痛!!!!!!!!!!
- 图片是存入数据库还是存路径?
- hibernate cascade=save-updae 在annotation里面对应的是哪项?
- 为什么执行ServerSocket.accept()就死机了??急盼答复,谢谢啊。
- Cannot forward after response has been committed错误
- 登陆小问题!
- 帮忙看看我这段程序哪里出错,谢谢!
- ■■请问大家在.ear或.war中原来URL所跳转的servlet或jsp页面如何设置??
- 我已经没有分了,但是我的问题却没有人解答。为什么????
- tomcat 运行 javabean
String[] list()
Returns an array of strings naming the files and directories in the directory denoted by this abstract pathname.
String[] list(FilenameFilter filter)
Returns an array of strings naming the files and directories in the directory denoted by this abstract pathname that satisfy the specified filter.
File[] listFiles()
Returns an array of abstract pathnames denoting the files in the directory denoted by this abstract pathname.
File[] listFiles(FileFilter filter)
Returns an array of abstract pathnames denoting the files and directories in the directory denoted by this abstract pathname that satisfy the specified filter.
File[] listFiles(FilenameFilter filter)
Returns an array of abstract pathnames denoting the files and directories in the directory denoted by this abstract pathname that satisfy the specified filter.
虽然我看不太懂
但是分送你吧
jbuilder我有的~~~~~~~~
string [] filename = dir.list();
就可以了!
呵呵
那得到的string [] filename
如何逐个得到文件名的值?
for(int i=0;i<filename.length;i++)
filename[i]....//里面就是文件名字呀注意会包含两个这样的值:"." 和 ".."
把它门去了
只是不知道返回的filename[]中的参数是数字逐个递增还是其他的办法~~~~~~~~~现在全明白了
谢谢海风老大
这个是我第一次在csdn提问
满意~