我使用C#来获取系统字体文件夹的确切路径。找不到哪个类/DLL可以这样做。
发布于 2018-08-06 16:29:03
string fontsfolder = System.Environment.GetFolderPath(
System.Environment.SpecialFolder.Fonts);
请注意,“特定文件夹”枚举中的“字体”文件夹仅在.NET 4及更高版本中可用。
发布于 2018-08-06 17:32:34
此代码示例使用系统文件夹并执行此操作。还有其他文件夹可以关闭。
using System.IO;
// get parent of System folder to have Windows folder
DirectoryInfo dirWindowsFolder = Directory.GetParent(Environment.GetFolderPath(Environment.SpecialFolder.System));
// Concatenate Fonts folder onto Windows folder.
string strFontsFolder = Path.Combine(dirWindowsFolder.FullName, "Fonts");
// Results in full path e.g. "C:\Windows\Fonts"
https://stackoverflow.com/questions/-100001966
复制相似问题