private static void CreateLogFileIfNotExist(string fullPath)
{
try
{
FileInfo fileInfo = new FileInfo(fullPath);
if (!fileInfo.Directory.Exists)
{
fileInfo.Directory.Create();
}
if (!File.Exists(fullPath))
{
File.Create(fullPath).Dispose( );
}
}
catch (IOException ioex)
{
Console.WriteLine(ioex. Message);
}
}
No comments:
Post a Comment