How to

delete readonly file

Published: 30. November 2011 | Updated: 30. November 2011
License: Microsoft Public License (MS-PL)
Categories: File system » Files
Tags: C# File System Windows
Was this snippet helpful for you? YESYES / NONO

Import namespace

using System.IO;

Code

string path = @"C:\Test\file.txt";

File.SetAttributes(path, FileAttributes.Normal);
File.Delete(path);
Send us feedback about this snippet »



Related Snippets: