How to delete a file from the server?

Platform: ASP.NET|Category: Files

VB.NET

System.IO.File.Delete(Server.MapPath('wnew.txt'))

C#

System.IO.File.Delete(Server.MapPath('wnew.txt'))

Make sure that you have permissions to delete a file.