Beispiel #1
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            string SecIniPath = ConfigurationManager.AppSettings["SecIniPath"].ToString();
            string SystemID   = ConfigurationManager.AppSettings["SystemID"].ToString();
            string ConnList   = ConfigurationManager.AppSettings["ConnList"].ToString();

            string[] system = SystemID.Split(new char[',']);
            string[] conns  = ConnList.Split(new char[',']);
            #region ³]©wKey1 and Key2
            //ŪiniÀÉ
            Vista.SEC.Coder   coder = new Vista.SEC.Coder();
            Vista.SEC.IniUtil INI   = new Vista.SEC.IniUtil(SecIniPath);
            Application.Add("SECKey1", coder.Decrypt(INI.ReadValue("Main", "Key1")));
            Application.Add("SECKey2", coder.Decrypt(INI.ReadValue("Main", "Key2")));
            #endregion

            #region ³]©wConnection Pool

            Vista.SEC.ConnectionPool CP = new Vista.SEC.ConnectionPool(SecIniPath);
            foreach (var conn in conns)
            {
                CP.SetConnection(conn);
            }

            //Vista.DBSSEC.ConnectionPool CP;
            //CP = new Vista.DBSSEC.ConnectionPool(SecIniPath);
            //CP.SetConnection(SystemID, ConnList);


            //for (int i = 0; i < system.Length; i++)
            //{
            //    Application.Add(system[i], Vista.DBSSEC.ConnectionPool.GetConnection(conns[i]));
            //}
            //Application.Add("CONNSEC", Vista.DBSSEC.ConnectionPool.GetConnection("CONNSEC"));
            //Application.Add("CONNPIPA", Vista.DBSSEC.ConnectionPool.GetConnection("CONNPIPA"));
            #endregion
        }
Beispiel #2
0
        void Application_Start(object sender, EventArgs e)
        {
            // 應用程式啟動時執行的程式碼
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            string SecIniPath = ConfigurationManager.AppSettings["SecIniPath"].ToString(); //"D:\\Solution1\\INI\\RES.ini"
            //string SystemID = ConfigurationManager.AppSettings["SystemID"].ToString();     //"RES"
            string ConnList = ConfigurationManager.AppSettings["ConnList"].ToString();     //"CONNCLEAN"

            //string[] system = SystemID.Split(new char[] { ',' });
            string[] conns = ConnList.Split(new char[] { ',' });

            #region 設定Key1 and Key2

            Vista.SEC.Coder   coder = new Vista.SEC.Coder();
            Vista.SEC.IniUtil INI   = new Vista.SEC.IniUtil(SecIniPath);
            Application.Add("SECKey1", coder.Decrypt(INI.ReadValue("Main", "Key1")));
            Application.Add("SECKey2", coder.Decrypt(INI.ReadValue("Main", "Key2")));
            #endregion

            #region 設定Connection Pool

            Vista.SEC.ConnectionPool CP = new Vista.SEC.ConnectionPool(SecIniPath);
            foreach (var conn in conns)
            {
                CP.SetConnection(conn);
            }

            //CP = new Vista.DBSSEC.ConnectionPool(SecIniPath);
            //CP.SetConnection(SystemID, ConnList);

            //for (int i = 0; i< system.Length;i++)
            //{
            //    Application.Add(system[i],Vista.DBSSEC.ConnectionPool.GetConnection(conns[i]));
            //}

            //Application.Add("CONNSEC", Vista.DBSSEC.ConnectionPool.GetConnection("CONNSEC"));
            //Application.Add("CONNPIPA", Vista.DBSSEC.ConnectionPool.GetConnection("CONNPIPA"));
            #endregion
        }
Beispiel #3
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            GlobalConfiguration.Configure(WebApiConfig.Register);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            //API JSon
            GlobalConfiguration.Configuration.Formatters.XmlFormatter.SupportedMediaTypes.Clear();

            string SecIniPath = ConfigurationManager.AppSettings["SecIniPath"].ToString();
            //string SystemID = ConfigurationManager.AppSettings["SystemID"].ToString();  //A,B,C
            string ConnList = ConfigurationManager.AppSettings["ConnList"].ToString();  //1,2,3

            //string[] system = SystemID.Split(new char[] { ',' });
            string[] conns = ConnList.Split(new char[] { ',' });

            #region ³]©wKey1 and Key2

            Vista.SEC.Coder   coder = new Vista.SEC.Coder();
            Vista.SEC.IniUtil INI   = new Vista.SEC.IniUtil(SecIniPath);
            Application.Add("SECKey1", coder.Decrypt(INI.ReadValue("Main", "Key1")));
            Application.Add("SECKey2", coder.Decrypt(INI.ReadValue("Main", "Key2")));

            #endregion

            #region ³]©wConnection Pool

            Vista.SEC.ConnectionPool CP = new Vista.SEC.ConnectionPool(SecIniPath);
            foreach (var conn in conns)
            {
                CP.SetConnection(conn);
            }
            //for (int i = 0; i < system.Length; i++)
            //{
            //    Application.Add(system[i], Vista.SEC.ConnectionPool.GetConnection(conns[i]));
            //}
            #endregion
        }
Beispiel #4
0
        void Application_Start(object sender, EventArgs e)
        {
            // 應用程式啟動時執行的程式碼

            string SecIniPath = ConfigurationManager.AppSettings["SecIniPath"].ToString();
            string SystemID   = ConfigurationManager.AppSettings["SystemID"].ToString();
            string ConnList   = ConfigurationManager.AppSettings["ConnList"].ToString();

            string[] system = SystemID.Split(new char[',']);
            string[] conns  = ConnList.Split(new char[',']);
            #region 設定Key1 and Key2
            //讀ini檔
            Vista.SEC.Coder   coder = new Vista.SEC.Coder();
            Vista.SEC.IniUtil INI   = new Vista.SEC.IniUtil(SecIniPath);
            Application.Add("SECKey1", coder.Decrypt(INI.ReadValue("Main", "Key1")));
            Application.Add("SECKey2", coder.Decrypt(INI.ReadValue("Main", "Key2")));
            #endregion

            #region 設定Connection Pool

            Vista.SEC.ConnectionPool CP = new Vista.SEC.ConnectionPool(SecIniPath);
            foreach (var conn in conns)
            {
                CP.SetConnection(conn);
            }

            //Vista.DBSSEC.ConnectionPool CP;
            //CP = new Vista.DBSSEC.ConnectionPool(SecIniPath);
            //CP.SetConnection(SystemID, ConnList);


            //for (int i = 0; i < system.Length; i++)
            //{
            //    Application.Add(system[i], Vista.DBSSEC.ConnectionPool.GetConnection(conns[i]));
            //}
            //Application.Add("CONNSEC", Vista.DBSSEC.ConnectionPool.GetConnection("CONNSEC"));
            //Application.Add("CONNPIPA", Vista.DBSSEC.ConnectionPool.GetConnection("CONNPIPA"));
            #endregion
        }