Пример #1
0
        public virtual void Load(MVC hostData)
        {
            var fileName = hostData.GetFullPath("config.txt");
            var lines    = System.IO.File.ReadAllLines(fileName);

            foreach (var temp in lines)
            {
                var line = temp;

                if (string.IsNullOrEmpty(line))
                {
                    continue;
                }

                if (line.Contains("#"))
                {
                    line = line.Split('#')[0];

                    if (string.IsNullOrEmpty(line))
                    {
                        continue;
                    }
                }

                var s = line.Split('=');
                if (s.Length >= 2)
                {
                    var fieldName  = s[0];
                    var fieldValue = s[1];
                    this.SetFieldValue(fieldName, fieldValue);
                }
            }
        }