test |
|
marsking
一般會員 發表:6 回覆:6 積分:2 註冊:2004-06-14 發送簡訊給我 |
public void showTree( string directoryValue , TreeNode parentNode)
{
try
{
if(Directory.GetDirectories( directoryValue ).Length != 0)
{
DirectoryInfo dir = new DirectoryInfo(directoryValue);
DirectoryInfo[] infoArray = dir.GetDirectories();
//string[] directoryArray = Directory.GetDirectories(directoryValue);
try
{
if ( infoArray.Length != 0)
{
foreach( DirectoryInfo info in infoArray)//string directory in directoryArray
{
TreeNode myNode = new TreeNode( info.Name);//directory
myNode.ImageIndex = 0;
parentNode.Nodes.Add( myNode );
showTree(info.FullName,myNode);//directory
}//end foreach
}//end if
}//end try
catch
{
}//end catch
}//end if
}//end try
catch
{
}//end catch
}//end showTre
|
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |