private SortedDictionary<string, string> ReadFontInformation() { var dictionary = new SortedDictionary<string, string>(); RegistryKey mykey = Registry.LocalMachine; // 打开注册表 RegistryKey mykeySub = mykey.OpenSubKey("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Fonts", true); //获取字体名 string[] mynames = mykeySub.GetValueNames(); foreach (string name in mynames) { //获取字体的文件名 string myvalue = mykeySub.GetValue(name).ToString(); if (myvalue.Substring(myvalue.Length - 4).ToUpper() == ".TTF" && myvalue.Substring(1, 2).ToUpper() != @":\") { string val = name.Substring(0, name.Length - 11); dictionary[val] = myvalue; } } mykeySub.Close(); return dictionary; }