building functions if value exist- coding question

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • slafta
    Forum Member
    • Nov 2004
    • 26

    building functions if value exist- coding question

    scenario:
    in my registry this exists:

    [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\W 3SVC\Parameters\Virtual Roots]
    "/"="c:\\inetpub\\wwwroot,,201"


    currently i was plying with:
    ControlSet001root=Registry.DoesKeyExist(HKEY_LOCAL _MACHINE, "\\SYSTEM\\ControlSet001\\Services\\W3SVC\\Paramet ers\\Virtual Roots\\/");



    i realized the code was wrong:
    it would have to be a nested if:

    ControlSet001root=Registry.DoesKeyExist(HKEY_LOCAL _MACHINE, "\\SYSTEM\\ControlSet001\\Services\\W3SVC\\Paramet ers\\Virtual Roots\\");

    and
    ControlSet001rootvalue= Registry.GetValue(HKEY_CURRENT_USER, "\\SYSTEM\\ControlSet001\\Services\\W3SVC\\Paramet ers\\Virtual Roots\\", "/", true);

    and then if (ControlSet001root)then
    if ControlSet001rootvalue ~= nil


    how would be the best way to code
    if value exist
Working...
X