private void button2_Click(object sender, EventArgs e) { addSeverPath addsp = new addSeverPath(); if (addsp.ShowDialog() == DialogResult.OK) { //刷新combox string path = System.Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); path = path + @"\Klei\DSTTools\"; string[] a = Directory.GetDirectories(path); comboBox1.Items.Clear(); foreach (string i in a) { string temp = i.Replace(Directory.GetParent(i).ToString() + "\\", ""); if (File.Exists(i + @"\intro.txt")) { String intro = File.ReadAllText(i + @"\intro.txt", Encoding.UTF8); temp = temp + "@[" + intro + "]"; } else { temp = temp + "@[无描述文件]"; } comboBox1.Items.Add(temp); } } }