Clear the Contents of a File January 20, 2023 by Tarik You can use the File.WriteAllText method. System.IO.File.WriteAllText(@"Path/foo.bar",string.Empty);