logancberrypie

C# File Functions

Apr 18th, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.64 KB | None | 0 0
  1.         static void AppendFile(string filename , string Text)
  2.         {
  3.             StreamWriter File = new StreamWriter(filename, true);
  4.             File.WriteLine("\n"+Text);
  5.             File.Close();
  6.         }
  7.         static void WriteFile(string filename, string Text)
  8.         {
  9.             StreamWriter File = new StreamWriter(filename);
  10.             File.Write(Text);
  11.             File.Close();
  12.         }
  13.  
  14.         static string Readfile(string filename)
  15.         {
  16.             StreamReader File = new StreamReader(filename);
  17.             string temp = File.ReadToEnd();
  18.             File.Close();
  19.             return (temp);
  20.         }
Advertisement
Add Comment
Please, Sign In to add comment