2010年12月13日
摘要: 使用C#新建或修改注册表DWORD键时有可能会抛出以下异常The type of the value object did not match the specified RegistryValueKind or the object could not be properly converted.原因是你新建的那个值已经超出了Int32的范围,解决方法如下:Int32 a = 0;unchecked{   a = (Int32)0xA0000009;}rk.SetValue("DWordValue",a, RegistryValueKind.DWord);关键在于unchecked的使用,这 阅读全文
posted @ 2010-12-13 23:35 lxcsmallcity 阅读(1286) 评论(0) 推荐(0) 编辑