Exemplo n.º 1
0
        public ConfigReader(string fileName)
        {
            try
            {
                using (FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read))
                {
                    DataContractJsonSerializer jsonFormatter = new DataContractJsonSerializer(typeof(ConfigReader));
                    ConfigReader data = (ConfigReader)jsonFormatter.ReadObject(fs);

                    Login      = data.Login;
                    Pass       = data.Pass;
                    Node       = data.Node;
                    BaseUrl    = data.BaseUrl;
                    SearchKey  = data.SearchKey;
                    SearchText = data.SearchText;
                    Subject    = data.Subject;
                    Message    = data.Message;
                }
            }
            catch (FileNotFoundException)
            {
                Console.WriteLine("Поместите файл config.json в директорию /bin/Debug/");
            }
        }
Exemplo n.º 2
0
 public Initialization()
 {
     conf          = new ConfigReader(configPath);
     CountBrowsers = new MultiThreadingCounter();
 }