Skip to content

Instantly share code, notes, and snippets.

@felipeabajo
Last active November 14, 2023 14:51
Show Gist options
  • Save felipeabajo/a07fa4142ca9d37e2c044f1d50277528 to your computer and use it in GitHub Desktop.
Save felipeabajo/a07fa4142ca9d37e2c044f1d50277528 to your computer and use it in GitHub Desktop.
Snippets for working with folders in C#
/*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