3

使用Microsoft.Win32.RegistryKey(或任何相关类),如何查询注册表项的最后写入时间?

4

1 回答 1

8

您将需要使用 P/Invoke 来调用 Win32 API:

MSDN:RegQueryInfoKey功能

来自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);
于 2013-03-25T17:28:53.053 回答