简体   繁体   中英

How Is This Returning NULL

My C# application license manager is returning NULL when checking for a Key's existence even though the key exists and my application is installed. I have tried running as an Administrator and add or removing backslashes in the Key path.

        RegistryKey LitenUpKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\LitenUp\NIT", false);
        if (LitenUpKey == null) {
            // Registry Key NOT Found
            return false;                
        }

证明它存在

NOTE: I am building as x64!

As @RbMm pointed out, the issues was in registry reflection between 32 bit and 64 bit. The following question showed me how to choose which view I saw. Here it is.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM