Reputation: 121
Please help me convert this line to C#.
objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" &
Hex(RegistryHive.LocalMachine), Long))
Related References in C#: System.Management
Thank you.
Additional Info:
Code was originally in VB.
Upvotes: 0
Views: 389
Reputation: 121
objManagementBaseObject.SetPropertyValue("hDefKey", (long)RegistryHive.LocalMachine);
is the C# equivalent to the VB.NET line.
Thanks for the insight!
Upvotes: 0
Reputation: 416149
It looks like RegistryHive.LocalMachine
is just an enum value, in which case passing it through Hex() is just a waste of time:
objManagmentBaseObject.SetPropertyValue("hDefKey", (long)RegistryHive.LocalMachine);
Upvotes: 3