csharp delete file if exists

Code Example - csharp delete file if exists

                
                        if(File.Exists(@"C:\test.txt"))
{
    File.Delete(@"C:\test.txt");
}
                    
                
 

csharp how to delete a file

                        
                                File.Delete(@"C:\Temp\Data\Authors.txt");
                            
                        
 

Related code examples