using System.Collections.Generic;
public static void Main()
DateTime start_date = new DateTime(2017,9,28);
DateTime end_date = new DateTime(2017,10,18);
string[] no_months = Enumerable.Range(0, Int32.MaxValue).Select(e => start_date.AddMonths(e)).TakeWhile(e => e.Month <= end_date.Month).Select(e => e.ToString("yyyy_MM")).ToArray();
foreach(string m in no_months)
List<string> list_mo = new List<string>();
for (DateTime date = start_date; date.Month <= end_date.Month; date = date.AddMonths(1))
list_mo.Add(date.ToString("yyyy_MM"));
foreach(string m in list_mo.ToArray())