How to

check that file exists

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

Import namespace

using System.IO;

Code

bool exists = File.Exists(@"C:\test.txt");
Send us feedback about this snippet »



Related Snippets: