public static string[] ZheHang(string string_0, string string_1) { ReadXml xml = ReadXml.Get(); if (xml.ZheHang.ContainsKey(string_1)) { PrintZheHangModel model = xml.ZheHang[string_1]; string configId = model.ConfigId; string tempId = model.TempId; return(ZheHang(string_0, configId, tempId)); } return(null); }
private ReadXml() { this.string_2 = Path.Combine(string_1, @"..\Config\Print\PrintConfig.xml"); this.loger = LogUtil.GetLogger <ReadXml>(); this.dict = new Dictionary <string, PrintFileModel>(); this.ZheHang = new Dictionary <string, PrintZheHangModel>(); if (string.Equals(TaxCardFactory.CreateTaxCard().SoftVersion, "FWKP_V2.0_Svr_Server")) { string_0 = Path.Combine(Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\fwkp.exe").GetValue("Path").ToString(), @"Bin\"); string_1 = Path.GetDirectoryName(string_0); this.string_2 = Path.Combine(string_1, @"..\Config\Print\PrintConfig.xml"); } if (File.Exists(this.string_2)) { XmlDocument document = new XmlDocument(); byte[] sourceArray = Convert.FromBase64String("FZoo0+wH8AgXWEjMAFRnOVt+ZImrQik1jiVirx3SQzoTTc8H/D9o32mIm2Fb6CnC"); byte[] destinationArray = new byte[0x20]; Array.Copy(sourceArray, 0, destinationArray, 0, 0x20); byte[] buffer3 = new byte[0x10]; Array.Copy(sourceArray, 0x20, buffer3, 0, 0x10); byte[] buffer4 = AES_Crypt.Decrypt(Convert.FromBase64String("FkC25FGxr7ANG8kSXdMQ1dc1q5h2nMtkTSy90S2NQks6FTRmwMwaGUhrgVdlpMrhTSdJ9l7s5jbUyGMhyCd26w=="), destinationArray, buffer3, null); byte[] buffer5 = new byte[0x20]; Array.Copy(buffer4, 0, buffer5, 0, 0x20); byte[] buffer6 = new byte[0x10]; Array.Copy(buffer4, 0x20, buffer6, 0, 0x10); FileStream stream = new FileStream(this.string_2, FileMode.Open); byte[] buffer = new byte[stream.Length]; stream.Read(buffer, 0, buffer.Length); stream.Close(); byte[] buffer8 = AES_Crypt.Decrypt(buffer, buffer5, buffer6, null); document.Load(new XmlTextReader(new MemoryStream(buffer8))); foreach (XmlNode node in document.DocumentElement.ChildNodes) { XmlElement element2 = node as XmlElement; if ((element2 != null) && (element2.Name == "Print")) { string attribute = element2.GetAttribute("Id"); if (!this.ContainsKey(attribute)) { PrintFileModel model = new PrintFileModel { Id = attribute, CanvasName = element2.GetAttribute("Canvas"), AssemblyName = element2.GetAttribute("Assembly"), ClassName = element2.GetAttribute("Class") }; this.Add(new KeyValuePair <string, PrintFileModel>(attribute, model)); } } if ((element2 != null) && (element2.Name == "Zh")) { foreach (XmlNode node2 in element2.ChildNodes) { XmlElement element3 = node2 as XmlElement; if ((element3 != null) && (element3.Name == "Item")) { string key = element3.GetAttribute("Id"); string str3 = element3.GetAttribute("ConfigId"); string str4 = element3.GetAttribute("TempId"); if (!this.ZheHang.ContainsKey(key)) { PrintZheHangModel model2 = new PrintZheHangModel { Id = key, ConfigId = str3, TempId = str4 }; this.ZheHang.Add(key, model2); } } } } } } }