Cc writes a line of data to the file through the stream

From , 5 Years ago, written in C#, viewed 210 times.
URL https://pastebin.vip/view/eb7cdec4
  1. using System;
  2. using System.IO;
  3.  
  4. public class WriteFileStuff {
  5.  
  6. public static void Main() {
  7.        FileStream fs = new FileStream("c:\\tmp\\WriteFileStuff.txt", FileMode.OpenOrCreate, FileAccess.Write);                 
  8.        StreamWriter sw = new StreamWriter(fs);
  9.        try {
  10.                 sw.WriteLine("Howdy World.");
  11.         } finally {
  12.                 if(sw != null) { sw.Close(); }
  13.         }
  14. }
  15. }
  16.  
  17. //csharp/4813

Reply to "Cc writes a line of data to the file through the stream"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website