How to Delete File from File System in .NET


If you want to delete any file from the file system in .NET you can use Delete method of File class. Delete is static method and it requires file physical path to perform delete operation.

File.Delete("D:\\abc.txt");

 

 

About author


User avatar

Waqas Anwar

Founder of EzzyLearning.com, Senior Consultant, Microsoft .NET and Web Technologies

Add Comment