List<string> listStuInfo = new List<string>(); StreamReader sr = new StreamReader(_path, Encoding.Default); string sStrTemp = ""; TreeNode rootnode = new TreeNode("学生"); this.tvTest.Nodes.Add(rootnode); while ((sStrTemp = sr.ReadLine()) != null) { listStuInfo.Add(sStrTemp); } sr.Close(); for (int i = 0; i < listStuInfo.Count; i++) { string[] sAry = listStuInfo[i].Split(' '); TreeNode chdnode = new TreeNode(); chdnode.Text = sAry[0]; rootnode.Nodes.Add(chdnode); for (int j = 1; j < sAry.Length; j++) { TreeNode chdSonNode = new TreeNode(); chdSonNode.Text = sAry[j]; chdnode.Nodes.Add(chdSonNode); } } tvTest.Nodes[0].Expand();