Skip to content

Instantly share code, notes, and snippets.

View antoantonyk's full-sized avatar
:octocat:
Focusing

Anto Antony antoantonyk

:octocat:
Focusing
View GitHub Profile
string logFile = "log-" + DateTime.Now.ToString("yyyyMMdd") + ".txt";
string filePath = WebConfigurationManager.AppSettings["LogPath"].ToString();
//example --- c:/website/Logs/
if (!string.IsNullOrEmpty(filePath))
{
FileInfo fileInfo = new FileInfo(filePath);
if (!fileInfo.Exists)
Directory.CreateDirectory(filePath);