国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

java.IO搜索指定文件

2019-11-17 04:01:53
字體:
來源:轉載
供稿:網友
最近很郁悶,我的本本莫名其妙的中了一種嵌入式病毒,磁盤上的所有asp和html文件的結尾都加上了一句<iframe src=http://mm.uu88567.cn/index/mm.htm width=100 height=0></iframe>TMD那個不要臉的,為了刷流量干出這么損人的招

哎,么辦法,出了問題,那就解決問題吧。今天寫了一個讀取文件的類可是就是忘了,怎么用流讀取文件呢?

                          view plaincopy to clipboardPRint?
package org.zhang.io;   
  
import java.io.*;   
  
public class IOTest {   
    public static void main(String[] args) throws Exception {   
        fun("F://");   
    }   
  
    public static void fun(String dir) {   
        File f = new File(dir);   
        String[] str = null;   
        if (f.isDirectory()) {   
            str = f.list();   
            for (int i = 0; str != null && i < str.length; i++) {   
                fun(dir + File.separator + str[i]);   
            }   
        }else{   
            if (dir.endsWith("asp")) {   
                System.out.println(dir);   
            }   
        }   
    }   
}  
package org.zhang.io;

import java.io.*;

public class IOTest {
public static void main(String[] args) throws Exception {
fun("F://");
}

public static void fun(String dir) {
File f = new File(dir);
String[] str = null;
if (f.isDirectory()) {
str = f.list();
for (int i = 0; str != null && i < str.length; i++) {
fun(dir + File.separator + str[i]);
}
}else{
if (dir.endsWith("asp")) {
System.out.println(dir);
}
}
}
}

測試出指定路徑下的指定文件。

修改所有文件暫時么實現。(未完)
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 秦皇岛市| 儋州市| 姜堰市| 武功县| 海南省| 微博| 三台县| 朝阳市| 陇西县| 农安县| 谢通门县| 通渭县| 开封县| 西畴县| 石狮市| 宁明县| 临猗县| 西林县| 遵化市| 隆子县| 台东县| 新沂市| 通河县| 东至县| 沐川县| 广元市| 克山县| 大英县| 武邑县| 临湘市| 宝丰县| 宁南县| 海兴县| 应城市| SHOW| 凌云县| 盐城市| 南涧| 神木县| 上虞市| 甘德县|