Пример #1
0
        private List <string> GetSuffixLimt()
        {
            string suffixInfo;
            bool   result = ParseConfig.ParseInfo("UploadConfig\\SuffixLimit", out suffixInfo);

            if (result)
            {
                return(suffixInfo.Replace(" ", "").Split(",").ToList());
            }

            return(new List <string>());
        }
Пример #2
0
        private int GetSizeLimit()
        {
            string fileSize;
            bool   result = ParseConfig.ParseInfo("UploadConfig\\MaxSize", out fileSize);

            if (result)
            {
                return(int.Parse(fileSize));
            }

            return(4000000);
        }
Пример #3
0
        public BaseFilter()
        {
            string serviceUrl;

            ParseConfig.ParseInfo("ServicesUrl\\UserService", out serviceUrl);
            var options = new List <ChannelOption>
            {
                new ChannelOption("grpc.initial_reconnect_backoff_ms", 100),
            };

            Channel = new Channel(serviceUrl, ChannelCredentials.Insecure, options);
        }
Пример #4
0
        public BaseController(string serviceConfig)
        {
            string value  = "";
            bool   result = ParseConfig.ParseInfo(serviceConfig, out value);

            if (result)
            {
                var baseService = new BaseService(value);
                Channel = baseService.Channel;
            }
            else
            {
                Channel = null;
            }
        }
Пример #5
0
        private string GetUploaddir()
        {
            string defaultPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "wwwroot", "UploadFiles");
            string settingPath = "";
            bool   result      = ParseConfig.ParseInfo("UploadConfig\\Path", out settingPath);

            if (result && settingPath != "")
            {
                if (System.IO.Directory.Exists(settingPath))
                {
                    //Console.WriteLine("Setting upload directory is not exist, use default instead.");
                    logger.LogInformation("Setting upload directory is not exist, use default instead.");
                }
                else
                {
                    return(settingPath);
                }
            }
            return(defaultPath);
        }