110,571
社区成员
发帖
与我相关
我的任务
分享
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace WindowsFormsApplication4
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
TreeView TV = new TreeView();
TV.Parent = this;
TV.Dock = DockStyle.Fill;
String S = Environment.GetFolderPath(Environment.SpecialFolder.MyComputer );
TV.Nodes.Add("我的电脑");
foreach (String FileName in Directory.GetFiles(S))
TV.Nodes[0].Nodes.Add(FileName);
}
}
}