Last active
November 14, 2023 14:51
-
-
Save felipeabajo/a07fa4142ca9d37e2c044f1d50277528 to your computer and use it in GitHub Desktop.
Snippets for working with folders in C#
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
/*OPERATIONS WITH FOLDERS*/ | |
/*Check if folder exists*/ | |
private Boolean ExistsFolder(string folderPath) | |
{ | |
if (Directory.Exists(folderPath)) return true; | |
else return false; | |
} | |
/*Create folder*/ | |
private void CreateFolder(string folderPath) | |
{ | |
if (!Directory.Exists(folderPath)) | |
Directory.CreateDirectory(folderPath); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment