コード例 #1
0
 public static void Init()
 {
     if (!isInitialized)
     {
         var path = HttpRuntime.AppDomainAppPath;
         var di   = new DirectoryInfo(path);
         var configDirectories = di.GetDirectories("config", SearchOption.AllDirectories);
         if (configDirectories.Length > 0)
         {
             DFPub.ConfigFolder = configDirectories[0].FullName;
             var list = DFPub.CheckFormConfig(DFPub.ConfigFolder);
             if (list.Count > 0)
             {
                 throw new Exception(string.Join(Environment.NewLine, list));
             }
         }
         else
         {
             throw new Exception("不能找到表单页面配置的 config 目录".GetRes());
         }
         Pub.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["default"].ConnectionString;
         isInitialized        = true;
         WFRes.Instance.Load();
     }
 }