public bool AddPath(string XSDPath) { fileScheme = Directory.GetFiles(XSDPath, "*.xsd"); if (fileScheme.Length != 0) { return(true); } else { _log.WriteLog(LogLevel.Error, $"Not found to folder \"XSD\" files"); return(false); } }
public void Move(string source, string destination) { try { //string NoValidePath = $"{Directory.GetCurrentDirectory()}\\NoValide"; if (Directory.Exists(destination) == false) { Directory.CreateDirectory(destination); _log.WriteLog(LogLevel.Info, "create folder"); } File.Move(source, $"{destination}\\{Path.GetFileName(source)}"); _log.WriteLog(LogLevel.Move, $"file: [{Path.GetFileName(source)}]"); } catch (Exception ex) { _log.WriteLog(LogLevel.Error, ex.Message); } }
public bool addPath(string XMLPath) { try { filePath = Directory.GetFiles(XMLPath, "*.xml"); if (filePath.Length != 0) { return(true); } else { _log.WriteLog(LogLevel.Error, "Not found to folder \"XML\" files"); return(false); } }catch (Exception ex) { _log.WriteLog(LogLevel.Error, ex.Message); return(false); } }
public async Task <Config> Load() { try { using (FileStream stream = new FileStream($"{Directory.GetCurrentDirectory()}\\config.json", FileMode.Open)) { Config config = await JsonSerializer.DeserializeAsync <Config>(stream); return(config); } } catch (Exception ex) { _log.WriteLog(LogLevel.Error, ex.Message); return(null); } }