Beispiel #1
0
        public Canvas(string string_1)
        {
            this.size_0     = new Size(800, 600);
            this._Margin    = new Margins(0, 0, 0, 0);
            this.startPoint = new PointF(0f, 0f);
            this.string_0   = string.Empty;
            if (!File.Exists(string_1))
            {
                throw new FileNotFoundException();
            }
            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(string_1, 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)));
            this.string_0 = Path.GetFileName(string_1);
            this.method_1(document);
        }
Beispiel #2
0
        public static string DecryptFile(string inFileName)
        {
            string path = sysTempDir + Path.GetFileName(inFileName);

            try
            {
                FileStream stream = new FileStream(inFileName, FileMode.Open, FileAccess.Read);
                byte[]     buffer = new byte[stream.Length];
                stream.Read(buffer, 0, buffer.Length);
                DateTime time    = new DateTime(0x7dd, 9, 10, 8, 0x22, 30);
                TimeSpan span    = (TimeSpan)(DateTime.Now - time);
                byte[]   buffer2 = AES_Crypt.Encrypt(ToolUtil.GetBytes(span.TotalSeconds.ToString("F1")), new byte[] {
                    0xff, 0x42, 0xae, 0x95, 11, 0x51, 0xca, 0x15, 0x21, 140, 0x4f, 170, 220, 0x92, 170, 0xed,
                    0xfd, 0xeb, 0x4e, 13, 0xac, 0x80, 0x52, 0xff, 0x45, 0x90, 0x85, 0xca, 0xcb, 0x9f, 0xaf, 0xbd
                }, new byte[] { 0xf2, 0x1f, 0xac, 0x5b, 0x2c, 0xc0, 0xa9, 0xd0, 0xbc, 0xaf, 0x86, 0x99, 0xad, 170, 0xfb, 0x60 });
                byte[] buffer3 = AES_Crypt.Decrypt(buffer, key, vec, buffer2);
                if (buffer3 == null)
                {
                    stream.Close();
                    return("");
                }
                FileStream stream2 = new FileStream(path, FileMode.Create, FileAccess.Write)
                {
                    Position = 0L
                };
                stream2.Write(buffer3, 0, buffer3.Length);
                stream.Close();
                stream2.Close();
            }
            catch
            {
                return("");
            }
            return(path);
        }
Beispiel #3
0
        internal void method_7(string string_1, string string_2)
        {
            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(Path.Combine(string_2, string_1), FileMode.Open);

            byte[] buffer = new byte[stream.Length];
            stream.Read(buffer, 0, buffer.Length);
            stream.Close();
            XmlTextReader reader = new XmlTextReader(new MemoryStream(AES_Crypt.Decrypt(buffer, buffer5, buffer6, null)));

            while (reader.Read())
            {
                if (reader.IsStartElement())
                {
                    string str;
                    if (((str = reader.LocalName) == null) || !(str == "SQLLIB"))
                    {
                        reader.Close();
                        throw new Exception1("不支持的SQL资源文件");
                    }
                    this.method_10(reader);
                }
            }
            reader.Close();
        }
        public static DockForm RunCommand(byte[] value)
        {
            string str = "Aisino.Fwkp.Invoice.ActiveX.TaxCardQuery_Status";

            byte[] bytes            = ToolUtil.GetBytes(MD5_Crypt.GetHashStr(str));
            byte[] destinationArray = new byte[0x20];
            Array.Copy(bytes, 0, destinationArray, 0, 0x20);
            byte[] buffer3 = new byte[0x10];
            Array.Copy(bytes, 0x20, buffer3, 0, 0x10);
            DateTime time = DateTime.Parse(ToolUtil.GetString(AES_Crypt.Decrypt(value, destinationArray, buffer3, null)));
            DateTime now  = DateTime.Now;

            if ((time.CompareTo(now) > 0) || (time.CompareTo(now.AddSeconds(-1.0)) < 0))
            {
                return(null);
            }
            WaitForm form = new WaitForm {
                StartPosition = FormStartPosition.CenterScreen,
                ShowInTaskbar = false
            };

            form.Show();
            bool flag = form.DataCheck();

            form.Close();
            if (!flag)
            {
                return(null);
            }
            if (form.bIsNeedRepair)
            {
                MessageManager.ShowMsgBox("INP-253207", new string[] { form.strRet });
            }
            return(new InvoiceReportForm());
        }
Beispiel #5
0
        public static BaseForm RunCommand(byte[] value)
        {
            string str = "Aisino.Fwkp.Invoice.ActiveX.TaxCardQuery_Year";

            byte[] bytes            = ToolUtil.GetBytes(MD5_Crypt.GetHashStr(str));
            byte[] destinationArray = new byte[0x20];
            Array.Copy(bytes, 0, destinationArray, 0, 0x20);
            byte[] buffer3 = new byte[0x10];
            Array.Copy(bytes, 0x20, buffer3, 0, 0x10);
            DateTime time = DateTime.Parse(ToolUtil.GetString(AES_Crypt.Decrypt(value, destinationArray, buffer3, null)));
            DateTime now  = DateTime.Now;

            if ((time.CompareTo(now) <= 0) && (time.CompareTo(now.AddSeconds(-1.0)) >= 0))
            {
                if (taxcardEntityBLL.IsLocked())
                {
                    MessageManager.ShowMsgBox("INP-253109");
                    return(null);
                }
                DataSumForm form = new DataSumForm(false)
                {
                    StartPosition            = FormStartPosition.CenterScreen,
                    ShowInTaskbar            = false,
                    strLabelYearOrStartMonth = "起始月份",
                    strLabelEndMonth         = "结束月份",
                    bLabelTaxPeriod          = false,
                    bComboxTaxPeriod         = false
                };
                if (form.ShowDialog() == DialogResult.OK)
                {
                    TaxDateSegment segment = new TaxDateSegment();
                    try
                    {
                        segment.m_nYear       = form.nTaxYear;
                        segment.m_nStartMonth = form.nStartMonth;
                        segment.m_nEndMonth   = form.nEndMonth;
                        segment.m_nTaxPeriod  = Convert.ToInt32(form.strTaxPeriod);
                        return(new InvStatForm(segment, true)
                        {
                            Text = form.strDlgTitle, m_strTitle = form.strLabelTitle
                        });
                    }
                    catch (Exception exception)
                    {
                        MessageManager.ShowMsgBox("INP-253107", new string[] { exception.Message });
                        return(null);
                    }
                }
            }
            return(null);
        }
Beispiel #6
0
        internal static PlugIn smethod_0(string string_1)
        {
            PlugIn in2;

            try
            {
                if (dictionary_0 == null)
                {
                    dictionary_0 = new Dictionary <string, string>();
                    dictionary_0.Add("Auto", "/Aisino/Auto");
                    dictionary_0.Add("Toolbar", "/Aisino/Toolbar");
                    dictionary_0.Add("Menu", "/Aisino/Menu");
                    dictionary_0.Add("Tree", "/Aisino/Tree");
                }
                FormSplashHelper.MsgWait("正在加载插件:" + string_1);
                byte[] sourceArray      = Convert.FromBase64String("7Na8rAMiwkrjjdD3ovBEp1+7a77N+o8nsrh3X6B/K99RYmTt2+X7j7sk0z2WhONH");
                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("eqxLBR2DaUHwhQe5q4IYbBEPnlYiMBApixEZLPuKEP5GBTIJsWDHiTZLIa1KTjxql1eMbyDXPUn4BhJVyaLdfA=="), 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(string_1, FileMode.Open);
                byte[]     buffer = new byte[stream.Length];
                stream.Read(buffer, 0, buffer.Length);
                stream.Close();
                XmlTextReader reader = new XmlTextReader(new MemoryStream(AES_Crypt.Decrypt(buffer, buffer5, buffer6, null)));
                PlugIn        @in    = smethod_1(reader, Path.GetDirectoryName(string_1));
                @in.method_1(string_1);
                @in.method_6(true);
                reader.Close();
                in2 = @in;
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(in2);
        }
Beispiel #7
0
        private ReadXml()
        {
            this.string_0 = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), @"..\Config\Print\PrintConfig.xml");
            this.dict     = new Dictionary <string, PrintFileModel>();
            this.ZheHang  = new Dictionary <string, PrintZheHangModel>();
            if (File.Exists(this.string_0))
            {
                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_0, 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);
                if (buffer8 == null)
                {
                    return;
                }
                document.Load(new XmlTextReader(new MemoryStream(buffer8)));
                foreach (XmlNode node in document.DocumentElement.ChildNodes)
                {
                    XmlElement element = node as XmlElement;
                    if ((element != null) && (element.Name == "Print"))
                    {
                        string attribute = element.GetAttribute("Id");
                        if (!this.ContainsKey(attribute))
                        {
                            PrintFileModel model = new PrintFileModel {
                                Id           = attribute,
                                CanvasName   = element.GetAttribute("Canvas"),
                                AssemblyName = element.GetAttribute("Assembly"),
                                ClassName    = element.GetAttribute("Class")
                            };
                            this.Add(new KeyValuePair <string, PrintFileModel>(attribute, model));
                        }
                    }
                    if ((element != null) && (element.Name == "Zh"))
                    {
                        foreach (XmlNode node2 in element.ChildNodes)
                        {
                            XmlElement element2 = node2 as XmlElement;
                            if ((element2 != null) && (element2.Name == "Item"))
                            {
                                string key  = element2.GetAttribute("Id");
                                string str3 = element2.GetAttribute("ConfigId");
                                string str4 = element2.GetAttribute("TempId");
                                if (!this.ZheHang.ContainsKey(key))
                                {
                                    PrintZheHangModel model2 = new PrintZheHangModel {
                                        Id       = key,
                                        ConfigId = str3,
                                        TempId   = str4
                                    };
                                    this.ZheHang.Add(key, model2);
                                }
                            }
                        }
                    }
                    if ((element != null) && (element.Name == "QRM"))
                    {
                        XmlNodeList childNodes = element.ChildNodes;
                        int_0 = Common.ObjectToInt(element.GetAttribute("IsPrint"));
                    }
                }
            }
            Dictionary <string, int> jsPrintTemplate = ToolUtil.GetJsPrintTemplate();

            if (jsPrintTemplate.Count > 0)
            {
                foreach (string str6 in jsPrintTemplate.Keys)
                {
                    if (!this.ContainsKey(str6))
                    {
                        PrintFileModel model3 = new PrintFileModel {
                            Id           = str6,
                            CanvasName   = str6 + ".xml",
                            AssemblyName = "",
                            ClassName    = ""
                        };
                        this.Add(new KeyValuePair <string, PrintFileModel>(str6, model3));
                    }
                }
            }
        }
Beispiel #8
0
        public void SaveUserPrinterEdge(PrinterEventArgs printerEventArgs_0)
        {
            string      path     = Path.Combine(PropertyUtil.GetValue("MAIN_PATH"), @"Config\Print\PrinterManager.xml");
            XmlDocument document = new XmlDocument();

            try
            {
                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(path, 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);
                if (buffer8 != null)
                {
                    document.Load(new XmlTextReader(new MemoryStream(buffer8)));
                    XmlNode node = document.SelectSingleNode("/PrintConfig");
                    new PrintDocument();
                    if (this.Name == null)
                    {
                        this.Name = "user";
                    }
                    bool flag  = (((this.object_0 != null) && (this.object_0.Length >= 4)) && (this.object_0[1].ToString() == "1100053620")) && (this.object_0[2].ToString() == "593803");
                    bool flag2 = false;
                    if ((node.ChildNodes != null) || (node.ChildNodes.Count > 0))
                    {
                        for (int i = 0; i < node.ChildNodes.Count; i++)
                        {
                            XmlNode    oldChild = node.ChildNodes[i];
                            XmlElement element  = oldChild as XmlElement;
                            if (element.GetAttribute("name") == this.Name)
                            {
                                node.RemoveChild(oldChild);
                                i--;
                            }
                            else if (element.GetAttribute("name") == "_QD")
                            {
                                node.RemoveChild(oldChild);
                                i--;
                                flag2 = true;
                            }
                            else if ((element.GetAttribute("name") == "c_QD") && flag)
                            {
                                node.RemoveChild(oldChild);
                                i--;
                            }
                        }
                    }
                    if ((flag && (this.Name == "s_QD")) || flag2)
                    {
                        XmlElement newChild = document.CreateElement("Printer");
                        newChild.SetAttribute("name", "c_QD");
                        newChild.SetAttribute("left", printerEventArgs_0.Left.ToString());
                        newChild.SetAttribute("top", printerEventArgs_0.Top.ToString());
                        newChild.SetAttribute("system", "1");
                        newChild.SetAttribute("pagelenght", printerEventArgs_0.PageLenght.ToString());
                        newChild.SetAttribute("PrinterName", printerEventArgs_0.PrinterName);
                        newChild.SetAttribute("IsQuanDa", printerEventArgs_0.IsQuanDa.ToString());
                        node.AppendChild(newChild);
                        XmlElement element3 = document.CreateElement("Printer");
                        element3.SetAttribute("name", "s_QD");
                        element3.SetAttribute("left", printerEventArgs_0.Left.ToString());
                        element3.SetAttribute("top", printerEventArgs_0.Top.ToString());
                        element3.SetAttribute("system", "1");
                        element3.SetAttribute("pagelenght", printerEventArgs_0.PageLenght.ToString());
                        element3.SetAttribute("PrinterName", printerEventArgs_0.PrinterName);
                        element3.SetAttribute("IsQuanDa", printerEventArgs_0.IsQuanDa.ToString());
                        node.AppendChild(element3);
                    }
                    else
                    {
                        XmlElement element4 = document.CreateElement("Printer");
                        element4.SetAttribute("name", this.Name);
                        element4.SetAttribute("left", printerEventArgs_0.Left.ToString());
                        element4.SetAttribute("top", printerEventArgs_0.Top.ToString());
                        element4.SetAttribute("system", "1");
                        element4.SetAttribute("pagelenght", printerEventArgs_0.PageLenght.ToString());
                        element4.SetAttribute("PrinterName", printerEventArgs_0.PrinterName);
                        element4.SetAttribute("IsQuanDa", printerEventArgs_0.IsQuanDa.ToString());
                        node.AppendChild(element4);
                    }
                    document.Save(path);
                }
            }
            catch (Exception exception)
            {
                XmlDeclaration declaration = document.CreateXmlDeclaration("1.0", "UTF-8", "");
                document.AppendChild(declaration);
                XmlElement element5 = document.CreateElement("PrintConfig");
                element5.SetAttribute("Name", "user");
                document.AppendChild(element5);
                document.Save(path);
                this.UserPrinterArgs.PrinterName = this.printDocument_0.PrinterSettings.PrinterName;
                this.UserPrinterArgs.System      = "1";
                this.UserPrinterArgs.PageLenght  = 0;
                this.UserPrinterArgs.Name        = "user";
                this.UserPrinterArgs.IsQuanDa    = true;
                this.ilog_0.Error(exception.ToString());
            }
            finally
            {
                string   str3 = "ikAJxQPU3bNUWK0fMgeHxMFk5wjhSQPYnARPgkVEKVU4yjA7KoD3eo7c6tLP745I";
                FileInfo info = new FileInfo(path);
                Common.Encrypt(new FileInfo[] { info }, str3);
            }
        }
Beispiel #9
0
        private bool method_2(string string_1)
        {
            string      path     = Path.Combine(PropertyUtil.GetValue("MAIN_PATH"), "Config/Print/DefaultPrinterManager.xml");
            XmlDocument document = new XmlDocument();
            bool        flag     = false;

            try
            {
                string str3 = string_1;
                int    num  = str3.LastIndexOf(@"\");
                if (num != -1)
                {
                    str3 = str3.Substring(num + 1);
                }
                string str4 = str3;
                try
                {
                    object obj2 = Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers\" + str3 + @"\PrinterDriverData", "Model", "");
                    if ((obj2 != null) && (obj2.ToString().Length > 0))
                    {
                        flag = true;
                        str4 = obj2.ToString();
                    }
                    else
                    {
                        flag = false;
                    }
                }
                catch (Exception exception)
                {
                    this.ilog_0.Error(exception.Message);
                }
                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(path, 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);
                if (buffer8 == null)
                {
                    return(false);
                }
                document.Load(new XmlTextReader(new MemoryStream(buffer8)));
                XmlNode node = document.SelectSingleNode("/PrintConfig");
                new PrintDocument();
                XmlNodeList childNodes = node.ChildNodes;
                if ((childNodes != null) && (childNodes.Count != 0))
                {
                    if (!this.method_3(childNodes, str3) && flag)
                    {
                        this.method_3(childNodes, str4);
                    }
                    if ((this.DefaultPrinterArgs.PrinterName == null) || (this.DefaultPrinterArgs.PrinterName == ""))
                    {
                        this.DefaultPrinterArgs.PrinterName = this.printDocument_0.PrinterSettings.PrinterName;
                        this.DefaultPrinterArgs.System      = "0";
                        this.DefaultPrinterArgs.PageLenght  = 0;
                        this.DefaultPrinterArgs.Name        = "user";
                        this.DefaultPrinterArgs.Left        = 0f;
                        this.DefaultPrinterArgs.Top         = 0f;
                        this.DefaultPrinterArgs.IsQuanDa    = true;
                    }
                    return(false);
                }
                return(this.method_3(childNodes, str4));
            }
            catch (Exception)
            {
                return(false);
            }
        }
Beispiel #10
0
        private void method_1()
        {
            string      path     = Path.Combine(PropertyUtil.GetValue("MAIN_PATH"), @"Config\Print\PrinterManager.xml");
            XmlDocument document = new XmlDocument();

            try
            {
                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(path, 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);
                if (buffer8 == null)
                {
                    return;
                }
                document.Load(new XmlTextReader(new MemoryStream(buffer8)));
                XmlNode node = document.SelectSingleNode("/PrintConfig");
                new PrintDocument();
                string      name       = this.Name;
                XmlNodeList childNodes = node.ChildNodes;
                if ((childNodes == null) || (childNodes.Count == 0))
                {
                    goto Label_03ED;
                }
                bool        flag       = false;
                XmlElement  element    = null;
                IEnumerator enumerator = childNodes.GetEnumerator();
                {
                    XmlElement element2;
                    while (enumerator.MoveNext())
                    {
                        XmlNode current = (XmlNode)enumerator.Current;
                        element2 = current as XmlElement;
                        if (element2 != null)
                        {
                            XmlAttribute attribute = element2.Attributes["name"];
                            if (attribute.InnerText == this.Name)
                            {
                                goto Label_019C;
                            }
                            if (attribute.InnerText == "_QD")
                            {
                                element = element2;
                            }
                        }
                    }
                    goto Label_026B;
Label_019C:
                    flag = true;
                    this.UserPrinterArgs.Name        = element2.GetAttribute("name");
                    this.UserPrinterArgs.System      = element2.GetAttribute("system");
                    this.UserPrinterArgs.Top         = Common.ObjectToFloat(element2.GetAttribute("top"));
                    this.UserPrinterArgs.Left        = Common.ObjectToFloat(element2.GetAttribute("left"));
                    this.UserPrinterArgs.PageLenght  = Common.ObjectToInt(element2.GetAttribute("pageLenght"));
                    this.UserPrinterArgs.PrinterName = element2.GetAttribute("PrinterName");
                    this.UserPrinterArgs.IsQuanDa    = Common.ObjectToBool(element2.GetAttribute("IsQuanDa"));
                }
Label_026B:
                if (!flag && (element != null))
                {
                    XmlAttribute attribute2 = element.Attributes["name"];
                    if (attribute2.InnerText == "_QD")
                    {
                        flag = true;
                        this.UserPrinterArgs.Name        = this.Name;
                        this.UserPrinterArgs.System      = element.GetAttribute("system");
                        this.UserPrinterArgs.Top         = Common.ObjectToFloat(element.GetAttribute("top"));
                        this.UserPrinterArgs.Left        = Common.ObjectToFloat(element.GetAttribute("left"));
                        this.UserPrinterArgs.PageLenght  = Common.ObjectToInt(element.GetAttribute("pageLenght"));
                        this.UserPrinterArgs.PrinterName = element.GetAttribute("PrinterName");
                        this.UserPrinterArgs.IsQuanDa    = Common.ObjectToBool(element.GetAttribute("IsQuanDa"));
                    }
                }
                if ((this.UserPrinterArgs.PrinterName == null) || (this.UserPrinterArgs.PrinterName == ""))
                {
                    this.UserPrinterArgs.PrinterName = this.printDocument_0.PrinterSettings.PrinterName;
                    this.UserPrinterArgs.System      = "1";
                    this.UserPrinterArgs.PageLenght  = 0;
                    this.UserPrinterArgs.Name        = "user";
                    this.UserPrinterArgs.Left        = 0f;
                    this.UserPrinterArgs.Top         = 0f;
                    this.UserPrinterArgs.IsQuanDa    = true;
                }
                return;

Label_03ED:
                this.UserPrinterArgs.PrinterName = this.printDocument_0.PrinterSettings.PrinterName;
                this.UserPrinterArgs.System      = "1";
                this.UserPrinterArgs.PageLenght  = 0;
                this.UserPrinterArgs.Name        = "user";
                this.UserPrinterArgs.Left        = 0f;
                this.UserPrinterArgs.Top         = 0f;
                this.UserPrinterArgs.IsQuanDa    = true;
            }
            catch (Exception)
            {
            }
        }
Beispiel #11
0
 private void method_1()
 {
     try
     {
         this.textRegex_ReceEmail_POP3.Text = PropertyUtil.GetValue("POP3_SERVER").Trim();
         int    result = 110;
         string s      = PropertyUtil.GetValue("POP3_PORT").Trim();
         if (!int.TryParse(s, out result) || (result <= 0))
         {
             s = "110";
         }
         this.textRegex_ReceEmail_POP3_GJ.Text = s;
         this.textRegex_SendEmail_SMTP.Text    = PropertyUtil.GetValue("SMTP_SERVER").Trim();
         int    num2 = 0x19;
         string str2 = PropertyUtil.GetValue("SMTP_PORT").Trim();
         if (!int.TryParse(str2, out num2) || (num2 <= 0))
         {
             str2 = "25";
         }
         this.textRegex_SendEmail_SMPT_GJ.Text = str2;
         this.textRegex_ZhangHuMing_Rece.Text  = PropertyUtil.GetValue("POP3_USER").Trim();
         this.textRegex_PassWord_Rece.Text     = (PropertyUtil.GetValue("POP3_PASS").Length == 0) ? "" : Encoding.Default.GetString(AES_Crypt.Decrypt(Convert.FromBase64String(PropertyUtil.GetValue("POP3_PASS").Trim()), byte_0, byte_1, null));
         string str3 = PropertyUtil.GetValue("SMTP_AUTH").Trim();
         this.chkBox_MyServerYanZheng_Send.Checked = string.IsNullOrEmpty(str3) || (str3 != "0");
         this.textRegex_ZhangHuMing_Send.Text      = PropertyUtil.GetValue("SMTP_USER").Trim();
         this.textRegex_PassWord_Send.Text         = (PropertyUtil.GetValue("SMTP_PASS").Length == 0) ? "" : Encoding.Default.GetString(AES_Crypt.Decrypt(Convert.FromBase64String(PropertyUtil.GetValue("SMTP_PASS").Trim()), byte_0, byte_1, null));
         string str4 = PropertyUtil.GetValue("MAIL_ALL_CONFIG").Trim();
         this.chkBox_SendItemSet_CG.Checked = string.IsNullOrEmpty(str4) || (str4 != "0");
         string str5 = PropertyUtil.GetValue("MAIL_ALL_SEND").Trim();
         this.chkBox_ZhiJieSend_CG.Checked = string.IsNullOrEmpty(str5) || (str5 != "0");
         string str6 = PropertyUtil.GetValue("MAIL_DEL").Trim();
         this.chkBox_ServerDeleteEmail_GJ.Checked = !string.IsNullOrEmpty(str6) && (str6 != "0");
         this.chkBox_MyServerYanZheng_Send_Click(this.chkBox_MyServerYanZheng_Send, null);
     }
     catch (BaseException exception)
     {
         this.ilog_0.Error(exception.Message);
         ExceptionHandler.HandleError(exception);
     }
     catch (Exception exception2)
     {
         this.ilog_0.Error(exception2.Message);
         ExceptionHandler.HandleError(exception2);
     }
 }
Beispiel #12
0
 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);
                         }
                     }
                 }
             }
         }
     }
 }