Link to home
Start Free TrialLog in
Avatar of Meinhoonaa
Meinhoonaa

asked on

need help with C# code

I need help to streamline my code. IF condition statement has too many strings to check. How can I improve it?  Code sample below. Thanks!


if (s == "AutoPickServer" || s == "DCInfo" || s == "CloseoutStation" || s == "Conveyor_UI" || s == "DivertService" || s == "EndDayMonitor")
                    {
                        using (RegistryKey key2 = rkey.OpenSubKey(s))
                            //PrintKeys(key2);
                            processValueNames(key2, s, registryDataTable);
                    }
ASKER CERTIFIED SOLUTION
Avatar of p_davis
p_davis

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Meinhoonaa
Meinhoonaa

ASKER

Thank you