예제 #1
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;
     }
 }
예제 #2
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;
     }
 }