RegistryKey最后写入时间
本文关键字:时间 最后 RegistryKey | 更新日期: 2023-09-27 18:05:52
使用Microsoft.Win32.RegistryKey
(或任何相关类),如何查询注册表项的最后写入时间?
您需要使用p/Invoke来调用Win32 API:
MSDN: RegQueryInfoKey
function
签名来自pinvoke.net:
[DllImport("advapi32.dll", EntryPoint="RegQueryInfoKey", CallingConvention=CallingConvention.Winapi, SetLastError=true)]
extern private static int RegQueryInfoKey(
UIntPtr hkey,
out StringBuilder lpClass,
ref uint lpcbClass,
IntPtr lpReserved,
out uint lpcSubKeys,
out uint lpcbMaxSubKeyLen,
out uint lpcbMaxClassLen,
out uint lpcValues,
out uint lpcbMaxValueNameLen,
out uint lpcbMaxValueLen,
out uint lpcbSecurityDescriptor,
IntPtr lpftLastWriteTime);