我在测试一个程序,当写入注册表时,
若键值的字符串太大,没有任何提示,
看起来写入成功了,但打开注册表一看,
键值没有更新。谢谢你的回答。

解决方案 »

  1.   

    请问Windows2000的注册表的键值的字符串最大为多少个字节?
    UP 
      

  2.   

    msdn中的连接
    ms-help://MS.MSDNQTR.2003JAN.1033/sysinfo/base/registry_element_size_limits.htmRegistry Element Size LimitsThe following are the size limits for the various registry elements.The maximum size of a key name is 255 characters.
    The maximum size of a value name is as follows: 
    Windows XP, Windows .NET Server 2003 family: 16383 characters 
    Windows 2000: 260 ANSI characters or 16383 Unicode characters. 
    Windows 95/98/Me: 255 characters 
    Long values (more than 2048 bytes) should be stored as files with the file names stored in the registry. This helps the registry perform efficiently. The maximum size of a value is as follows: 
    Windows NT/2000/XP: Available memory. 
    Windows 95/98/Me: 16,300 bytes. There is a 64K limit for the total size of all values of a key.