public static void SavePath(Path path, string fileName) { var writer = new StreamWriter(fileName + ".txt"); writer.WriteLine(path.ToString()); writer.Close(); }
public string GetPageContent(Path thePath) { try { using (var file = new FileStream(thePath.ToString(), FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) { using (var reader = new StreamReader(file, encoding)) { return reader.ReadToEnd(); } } } catch (FileNotFoundException) { // File does not exist, return null } catch (DirectoryNotFoundException) { // File's parent directory does not exist, return null } return null; }
public static void SavePaths(Path points, string filePath) { File.WriteAllText(filePath, points.ToString()); }