public static void CreateNewConfigFile() { SmanOraConfig OraCfg = new SmanOraConfig(); string Alias, UserName, Password, DataBase; GetSmanOraCfgParameters(out Alias, out UserName, out Password, out DataBase); OraCfg.Add(Alias, UserName, Password, DataBase); SmanOraConfig.Serialize(SmanConstants.configFileName, OraCfg); }
public static void Serialize(string file, SmanOraConfig config) { config.Encrypt(); XmlSerializer xs = new XmlSerializer(config.GetType()); StreamWriter writer = File.CreateText(file); xs.Serialize(writer, config); writer.Flush(); writer.Close(); }
public static void AddNewConfigFileEntity() { SmanOraConfig OraCfg = new SmanOraConfig(); try { OraCfg = SmanOraConfig.Deserialize(SmanConstants.configFileName); } catch { SmanMessage.RaiseError(SmanConstants.msgConfigFileError); } string Alias, UserName, Password, DataBase; GetSmanOraCfgParameters(out Alias, out UserName, out Password, out DataBase); OraCfg.Add(Alias, UserName, Password, DataBase); SmanOraConfig.Serialize(SmanConstants.configFileName, OraCfg); }
public static string GetConnectionString(string Alias) { SmanOraConfig OraCfg = new SmanOraConfig(); try { OraCfg = SmanOraConfig.Deserialize(SmanConstants.configFileName); } catch { SmanMessage.RaiseError(SmanConstants.msgConfigFileError); } return OraCfg.GetConnectionString(Alias); }