示例#1
0
 private static ActivationSet ToClass(string text)
 {
     using (StringReader sr = new StringReader(text)){
         using (ComSpex.XmlPersist <ActivationSet> xp = new ComSpex.XmlPersist <ActivationSet>()){
             return(xp.Load(sr));
         }
     }
 }
示例#2
0
 public static void LoadData(string path)
 {
     if (File.Exists(path))
     {
         FileInfo inf = new FileInfo(path);
         HttpContext.Current.Trace.Write(inf.FullName);
         using (StreamReader sr = new StreamReader(path)) {
             using (ComSpex.XmlPersist <ActivationSet[]> Xp = new ComSpex.XmlPersist <ActivationSet[]>()) {
                 ActivationSet[] items = Xp.Load(sr);
                 foreach (ActivationSet item in items)
                 {
                     if (!actCache.ContainsKey(item.MachineName.ToUpper()))
                     {
                         actCache.Add(item.MachineName.ToUpper(), item);
                     }
                 }
             }
         }
     }
 }