You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
1.0 KiB

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.IO;
  6. using OgFile = System.IO.File;
  7. namespace Net3_Proxy
  8. {
  9. public static class File
  10. {
  11. public static string ReadAllText(string fn) => OgFile.ReadAllText(fn);
  12. public static string ReadAllText(string fn, Encoding enc) => OgFile.ReadAllText(fn, enc);
  13. public static bool Exists(string fn) => OgFile.Exists(fn);
  14. public static void Delete(string fn) => OgFile.Delete(fn);
  15. public static void AppendAllLines(string path, IEnumerable<string> contents)
  16. {
  17. Path.Validate(path);
  18. if (contents == null)
  19. return;
  20. using (TextWriter textWriter = new StreamWriter(path, true))
  21. foreach (string value in contents)
  22. textWriter.WriteLine(value);
  23. }
  24. public static string[] ReadAllLines(string p) => OgFile.ReadAllLines(p);
  25. public static FileStream OpenRead(string p) => OgFile.OpenRead(p);
  26. }
  27. }