Exemple #1
0
        private string GetAppConfigPath()
        {
            foreach (var file in _appConfigFiles)
            {
                var f = MyHostingEnvironment.MapPath(file);
                if (File.Exists(f))
                {
                    return(f);
                }
            }

            string[] appEnvironments;
            if (System.Diagnostics.Debugger.IsAttached)   //调试时 先采用 开发文件
            {
                appEnvironments = new string[] { MyHostingEnvironment.EnvironmentName, "dev", "test", "prod" };
            }
            else
            {
                appEnvironments = new string[] { MyHostingEnvironment.EnvironmentName, "prod", "test", "dev" };
            }
            foreach (var item in appEnvironments)
            {
                foreach (var file in _appConfigFiles2)
                {
                    var f = MyHostingEnvironment.MapPath(string.Format(file, item));
                    if (File.Exists(f))
                    {
                        return(f);
                    }
                }
            }
            return(null);
        }
Exemple #2
0
 protected FileManagerControllerCore()
 {
     // FileManager Content Folder Path
     _webPath           = "/";
     _webRootPath       = MyHostingEnvironment.MapPath(_webPath);
     _allowedExtensions = new List <string> {
         "jpg", "jpe", "jpeg", "gif", "png", "svg", "txt", "pdf", "odp", "ods", "odt", "rtf", "doc", "docx", "xls", "xlsx", "ppt", "pptx", "csv", "ogv", "avi", "mkv", "mp4", "webm", "m4v", "ogg", "mp3", "wav", "zip", "rar", "md"
     };
 }