Hi @Vidhya,
Here is a sample for you.Just have a look.
Html
<asp:Label ID="lblMonthName" runat="server" />
Code
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
this.GetMonth();
}
}
private void GetMonth()
{
string[] records = { "\\recording\\SMT\\April-2013", "\\recording\\SMT\\May-2013", "\\recording\\SMT\\June-2013", "\\recording\\SMT\\JULY-2013", "\\recording\\SMT\\AUGUST-2013" };
foreach (string item in records)
{
string monthName = item.Substring(item.LastIndexOf("\\") + 1).Split('-')[0];
string currentMonth = System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(DateTime.Now.Month);
if (monthName == currentMonth)
{
this.lblMonthName.Text = "This is current month, and month is :" + currentMonth;
break;
}
}
}