This is a Code for "Create Directory Date Format in C#.net"
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace GetOfficeVersion
{
class ClsDirectory
{
public static void CreateDirectory(string DesignationPath)
{
if (!Directory.Exists(DesignationPath))
{
Directory.CreateDirectory(DesignationPath);
}
}
public static string currentYear()
{
string Year = string.Empty;
DateTime dt = DateTime.Now;
string format = "yyyy";
Year = dt.ToString(format);
return Year;
}
public static string currentMonth()
{
string Month = string.Empty;
DateTime dt = DateTime.Now;
string format = "MM";
Month = dt.ToString(format);
return Month;
}
public static string currentDate()
{
string day = string.Empty;
DateTime dt = DateTime.Now;
string format = "dd";
day = dt.ToString(format); return day;
}
}
}
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace GetOfficeVersion
{
class ClsDirectory
{
public static void CreateDirectory(string DesignationPath)
{
if (!Directory.Exists(DesignationPath))
{
Directory.CreateDirectory(DesignationPath);
}
}
public static string currentYear()
{
string Year = string.Empty;
DateTime dt = DateTime.Now;
string format = "yyyy";
Year = dt.ToString(format);
return Year;
}
public static string currentMonth()
{
string Month = string.Empty;
DateTime dt = DateTime.Now;
string format = "MM";
Month = dt.ToString(format);
return Month;
}
public static string currentDate()
{
string day = string.Empty;
DateTime dt = DateTime.Now;
string format = "dd";
day = dt.ToString(format); return day;
}
}
}