Skip to content

Instantly share code, notes, and snippets.

@ritacse
Created August 16, 2020 05:49
Show Gist options
  • Save ritacse/2322d74b4e5cadd994f5cff140354baa to your computer and use it in GitHub Desktop.
Save ritacse/2322d74b4e5cadd994f5cff140354baa to your computer and use it in GitHub Desktop.
//// Create directory on specific folder
string folderPath = "C:\\Excel\\";
if (!Directory.Exists(folderPath))
{
Directory.CreateDirectory(folderPath);
}
//// Get path of user "Documents" Folder
string user = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
//// Concate folder with existing directory
string folderPath = Path.Combine(user, "Excel\\");
if (!Directory.Exists(folderPath))
{
Directory.CreateDirectory(folderPath);
}
//// Get directory of project using specific file name
string fileName = "Shipment Date wise CST Summary.xlsx";
var directory = Path.GetFullPath(fileName);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment