_ | 覦覈襦 | 豕蠏手 | 殊螳 | 譯殊碁
FrontPage › Java-螻豸糾規譟磯朱慨蠍

hello world 襷螻 るジ蟇 2覯讌碁 console 谿企蓋. 1覯讌碁 SQLj 襦蠏碁伎螻, 願 2覯讌碁. 覘..朱... 蠏語 炎概貅一朱.. 貊 蠑語 蠏碁 ~

c:\test 襴螳 譟伎る 螳...
import java.io.File;

class FileTree{
	String depth;
	int d;
	FileTree(){
		depth = "";
		d = 0;
	}
	public String replicate(String str, int sum){
		String rs = "";
		for(int i=1; i <= sum; i++){
			rs = rs + str;
		}
		return rs;
	}
	public void addDepth(){
		d++;
		depth = replicate("	", d);
	}
	public void minusDepth(){
		d--;
		depth = replicate("	", d);
	}
	
	public void TreeList(String path){
		File f1 = new File(path);
		String s[] = f1.list();
		for(int i=0;i<s.length;i++){
			File child_f = new File(path + "\\" + s[i]);
			if (child_f.isDirectory()){
					addDepth();
					System.out.println(depth + path + "\\" + s[i]);
					TreeList(path + "\\" + s[i]);
					minusDepth();
			}else{
				addDepth();
				System.out.println(depth + s[i]);
				minusDepth();
			}
			
		}
	}
}

public class FileDirDemo1 {
	public static void main(String args[]){
		
		FileTree ftree = new FileTree();
		System.out.println("C:\\test");
		ftree.TreeList("C:\\test");
		
	}
}
蠍 蠍郁鍵..
企: : るジ讓曙 襦螻豺 企Ν 譯殊語. 襦螻豺
EditText : Print : Mobile : FindPage : DeletePage : LikePages : Powered by MoniWiki : Last modified 2018-04-13 23:12:53

螳襭 豺襦 螻讌螻 襷 襦 蟇一伎.