Ejemplo n.º 1
0
        protected void Application_Start(object sender, EventArgs e)
        {
            string applicationName = ConfigurationManager.AppSettings["ApplicationName"];
            if( !string.IsNullOrEmpty(applicationName) ) {
                MyDbConnection myConn = new MyDbConnection(applicationName);
                //初始化Map的数据库链接
                Mysoft.Map.Extensions.Initializer.UnSafeInit(myConn.GetConnectionString());

                //独立部署验证
                Application.Lock();
                Application["ESBToken"] = ConfigurationManager.AppSettings["ESBToken"];
                Application.UnLock();
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Processes the type of for each asynchronous operation.
 /// </summary>
 /// <param name="applicationName">Name of the application.</param>
 /// <param name="processor">The processor.</param>
 private static void ProcessForEachAsyncOperationType(string applicationName, AsyncOperationTypeProcessor processor)
 {
     MyDbConnection myConn;
     try
     {
         myConn = new MyDbConnection(applicationName);
     }
     catch
     {
         throw new AsyncServiceException(string.Format("未配置注册表数据库连接参数【{0}】,请确认已经在注册表中配置了该参数并拥有权限读取注册表!", applicationName));
     }
     //初始化Map1的数据库链接
     Mysoft.Map.Extensions.Initializer.UnSafeInit(myConn.GetConnectionString());
 }