// Arquivo de exemplo: TreeView.aspx.cs
using System;
using System.IO;
using System.Web.UI.WebControls;

public partial class TreeView : System.Web.UI.Page {
	protected void Page_Load(object sender, EventArgs e) {
		if (!IsPostBack) {
			string[] strDir = Directory.GetDirectories(@"C:\livro");
			string[] strFiles;

			foreach (string str in strDir) {
				TreeNode tree = new TreeNode(str);
				TreeView1.Nodes.Add(tree);
				strFiles = Directory.GetFiles(str);

				foreach (string str1 in strFiles)
				{
					TreeNode tree1 = new TreeNode(str1);
					tree.ChildNodes.Add(tree1);
				}
			}			
		}
	}
}
