/// <summary> /// Captura los nodos de Oracle Home definidos en el registro de Windows /// </summary> /// <returns>Lista genérica de OracleHomeNode</returns> public static List <OracleHomeNode> GetHomes() { List <OracleHomeNode> oracleList = new List <OracleHomeNode>(); using (RegistryKey key = Registry.LocalMachine.OpenSubKey("SOFTWARE\\ORACLE")) { if (key != null) { OracleHomeNode oh = processRegistry(key, true); if (oh != null) { oracleList.Add(oh); } string upperKey; foreach (string subkey in key.GetSubKeyNames()) { upperKey = subkey.ToUpper(); if (upperKey.StartsWith("HOME") || upperKey.StartsWith("KEY_")) { using (RegistryKey sub = key.OpenSubKey(upperKey)) { oh = processRegistry(sub, false); if (oh != null) { oracleList.Add(oh); } } } } } } return(oracleList); }
/// <summary> /// Captura todos los Alias de un TNSNAMES.ORA a partir de OracleHomeNode /// </summary> /// <param name="oracleHomeNode"></param> /// <returns></returns> public static string[] GetAlias(OracleHomeNode oracleHomeNode) { return(GetAlias(oracleHomeNode.OracleHome)); }