Use the FileInfo Class to Delete Files with Ease : File Command : File Stream C# Source Code


Custom Search

C# Source Code » File Stream » File Command »

 

Use the FileInfo Class to Delete Files with Ease








    

using System;
using System.IO;


  class Class1 {
    static void Main(string[] args) {
      string [] cla  = Environment.GetCommandLineArgs();
      if (cla.GetUpperBound(0) == 1)
      {
        FileInfo fi = new FileInfo(cla[1]);
        fi.Delete();
        Console.WriteLine("File      : " + cla[1]);
        Console.WriteLine("Attributes: " + fi.Attributes.ToString());
        Console.WriteLine("File Deleted...");
      }
      else
        Console.WriteLine ("Usage: rm <filename>");
    }
  }


           
       
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo File Stream
» File Command