Ejemplo n.º 1
0
 public static void SaveVariable(string file, ref EnvironmentVariable variable)
 {
     try
     {
         FileStream stream = File.Create(file);
         XmlSerializer xmlSerializer = new XmlSerializer(variable.GetType());
         xmlSerializer.Serialize(stream, variable);
         stream.Close();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 2
0
 public static void LoadVariable(string file, ref EnvironmentVariable variable)
 {
     try
     {
         FileStream stream = File.OpenRead(file);
         XmlSerializer xmlSerializer = new XmlSerializer(variable.GetType());
         variable = (EnvironmentVariable)xmlSerializer.Deserialize(stream);
         stream.Close();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }