troubleshooting Question

String is returning as String.String[] instead of value from registry

Avatar of athomsfere
athomsfereFlag for United States of America asked on
.NET ProgrammingC#Editors IDEs
4 Comments1 Solution571 ViewsLast Modified:
Can anyone shed some light on this?

I am querying the registry for a key value, on some image version it returns the value, and others it returns String.String[] instead.

What does that mean? How can I force it to read the key right (I have verified there is text there on the machines it returns wrong).

static string callImageVs(string PCName)
        {
            string imageVs = null;

            RegistryKey regKey = RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine, PCName);
            regKey = regKey.OpenSubKey(@"SYSTEM\Setup\");

            imageVs = Convert.ToString(regKey.GetValue("OEMDuplicatorString"));
           
            regKey.Close();
            

            return imageVs;
        }
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros