Example #1
0
        protected override void OnStart(string[] args)
        {
            string      currentPath = System.IO.Directory.GetCurrentDirectory();
            XmlDocument configXml   = new XmlDocument();
            string      path        = currentPath + "/DBConnection.xml";

            configXml.Load(path);

            XmlNodeList addNodes = configXml.SelectNodes("configuration/settings/add");

            foreach (XmlNode node in addNodes)
            {
                if (node.Attributes["key"].InnerText == "Team6")
                {
                    EncrytLibrary.AES aes = new EncrytLibrary.AES();
                    strConn = aes.AESDecrypt256((node.ChildNodes[0]).InnerText);
                    break;
                }
            }

            conn = new SqlConnection(strConn);
            conn.Open();

            timer          = new Timer();
            timer.Interval = 60000;
            timer.Elapsed += Timer_Elapsed;
            timer.Start();
        }
Example #2
0
        protected void Application_Start()
        {
            GlobalConfiguration.Configure(WebApiConfig.Register);

            log4net.Config.XmlConfigurator.Configure();

            string strConn = WebConfigurationManager.ConnectionStrings["DB"].ConnectionString;

            EncrytLibrary.AES aes = new EncrytLibrary.AES();
            strConn = aes.AESDecrypt256(strConn);
        }