c# - Can't Read Registry Key -


Let the code given below, tap the string returns after all, though, if I use the regedit to see this key I am then data in it Is Log On OnSmauser a Restricted Key?

  public static string end logon () {string enduser; RegistryKey.OpenBaseKey (RegistryHive.LocalMachine, RegistryView.Registry64); Registry Registry = Registry. OpenSubby (@ "Software Microsoft Windows Onwards / Authentication \ LogonUI", false); If (registryKey! = Null) {enduser = (string) registry. Gate value ("Lastlogged Onuserver"); } And final = "unknown user"; Return (final); }    

2 possible problems:

  1. you are Trying to read logon on user key, there is a lot of probability which means you will be LastLoggedOnSAMUser .
  2. If you have 32-bit registry entry 32-bit applications, change your platform target to x64 and try again. If not possible, then you may have to use the Registry API directly. Expect distance from a nudge in the right direction:

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -