Esempio n. 1
0
 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);
 }
Esempio n. 2
0
 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();
 }
Esempio n. 3
0
 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);
 }
Esempio n. 4
0
 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);
 }