Created
May 4, 2018 21:07
-
-
Save relliv/74efeae26b8dc106a43dd2a5514c4eda to your computer and use it in GitHub Desktop.
C# Folder & File Exists Checks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (File.Exists(@"C:\Users\usename\Documents\Folder\File.cs")) { | |
// File exists | |
} | |
else if (!File.Exists(@"C:\Users\usename\Documents\Folder\File.cs")) { | |
// File does not exists | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (Directory.Exists(@"C:\Users\usename\Documents\Folder")) { | |
// Folder exists | |
} | |
else if (!Directory.Exists(@"C:\Users\usename\Documents\Folder")) { | |
// Folder does not exists | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment