예제 #1
0
        public virtual void Save(ICrawlerObject obj)
        {
            string path = GetLoaclFilePath(obj.CrawlerFileName);

            JsonSerializerSettings settings = new JsonSerializerSettings()
            {
                Formatting = Formatting.Indented,
            };
            var json = JsonConvert.SerializeObject(obj, settings);

            using (var file = System.IO.File.CreateText(path))
            {
                file.Write(json);
                file.Flush();
            }
        }
예제 #2
0
 public virtual bool Exist(ICrawlerObject obj)
 {
     return(System.IO.File.Exists(GetLoaclFilePath(obj.CrawlerFileName)));
 }