C#札记[操作系统入门]
//获取文件夹:“C:UsersAdministratorAppDataRoaming”
var appData = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
//获取path文件夹及其子文件夹内所有dwg文件
var files = Directory.GetFiles(path, "*.dwg", SearchOption.AllDirectories);
//获取注册表:HKEY_LOCAL_MACHINESOFTWAREAutodeskHardcopy
using (var hklm = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64))
{
if (hklm != null)
{
using (var key = hklm.OpenSubKey(@"SOFTWAREAutodeskHardcopy"))
{
if (key != null)
{
var values = key.GetValueNames();
}
}
}
//获取注册表:HKEY_LOCAL_MACHINESOFTWAREAutodeskHardcopy
using (var hkcu = RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, RegistryView.Registry64))
{
if (hkcu != null)
{
using (var key = hkcu.OpenSubKey(@"SoftwareAutodeskAutoCADR19.1ACAD-D001:804ProfilesTArch9General"))
{
if (key != null)
{
var cadPrinterConfigDir = key.GetValue("PrinterConfigDir");
}
}
}
}
C#札记
原文:https://www.cnblogs.com/clinber/p/13676536.html
以上是 C#札记[操作系统入门] 的全部内容, 来源链接: utcz.com/z/519342.html