/// <summary>
/// Ãþ»¡©ú¡GAssistant
/// ½s ½X ¤H¡GÄ¬­¸
/// ÁpÃ´¤è¦¡¡G361983679  
/// §ó·sºô¯¸¡Ghttp://www.sufeinet.com/thread-655-1-1.html
/// </summary>
using System;

namespace DotNet.Utilities
{
    /// <summary>
    /// ¹A¾äÄÝ©Ê
    /// </summary>
    public class CNDate
    {
        /// <summary>
        /// ¹A¾ä¦~(¾ã«¬)
        /// </summary>
        public int cnIntYear = 0;
        /// <summary>
        /// ¹A¾ä¤ë¥÷(¾ã«¬)
        /// </summary>
        public int cnIntMonth = 0;
        /// <summary>
        /// ¹A¾ä¤Ñ(¾ã«¬)
        /// </summary>
        public int cnIntDay = 0;
        /// <summary>
        /// ¹A¾ä¦~(¤ä·F)
        /// </summary>
        public string cnStrYear = "";
        /// <summary>
        /// ¹A¾ä¤ë¥÷(¦r²Å)
        /// </summary>
        public string cnStrMonth = "";
        /// <summary>
        /// ¹A¾ä¤Ñ(¦r²Å)
        /// </summary>
        public string cnStrDay = "";
        /// <summary>
        /// ¹A¾äÄÝ¶H
        /// </summary>
        public string cnAnm = "";
        /// <summary>
        /// ¤G¤Q¥|¸`®ð
        /// </summary>
        public string cnSolarTerm = "";
        /// <summary>
        /// ³±¾ä¸`¤é
        /// </summary>
        public string cnFtvl = "";
        /// <summary>
        /// ¶§¾ä¸`¤é
        /// </summary>
        public string cnFtvs = "";
    }

    /// <summary>
    /// ¤½¾úÂà¹A¾ä
    /// </summary>
    public class ChinaDate
    {
        #region ¨p¦³¤èªk
        private static long[] lunarInfo = new long[] { 0x04bd8, 0x04ae0, 0x0a570, 0x054d5, 0x0d260, 0x0d950, 0x16554,
															   0x056a0, 0x09ad0, 0x055d2, 0x04ae0, 0x0a5b6, 0x0a4d0, 0x0d250, 0x1d255, 0x0b540, 0x0d6a0, 0x0ada2, 0x095b0,
															   0x14977, 0x04970, 0x0a4b0, 0x0b4b5, 0x06a50, 0x06d40, 0x1ab54, 0x02b60, 0x09570, 0x052f2, 0x04970, 0x06566,
															   0x0d4a0, 0x0ea50, 0x06e95, 0x05ad0, 0x02b60, 0x186e3, 0x092e0, 0x1c8d7, 0x0c950, 0x0d4a0, 0x1d8a6, 0x0b550,
															   0x056a0, 0x1a5b4, 0x025d0, 0x092d0, 0x0d2b2, 0x0a950, 0x0b557, 0x06ca0, 0x0b550, 0x15355, 0x04da0, 0x0a5d0,
															   0x14573, 0x052d0, 0x0a9a8, 0x0e950, 0x06aa0, 0x0aea6, 0x0ab50, 0x04b60, 0x0aae4, 0x0a570, 0x05260, 0x0f263,
															   0x0d950, 0x05b57, 0x056a0, 0x096d0, 0x04dd5, 0x04ad0, 0x0a4d0, 0x0d4d4, 0x0d250, 0x0d558, 0x0b540, 0x0b5a0,
															   0x195a6, 0x095b0, 0x049b0, 0x0a974, 0x0a4b0, 0x0b27a, 0x06a50, 0x06d40, 0x0af46, 0x0ab60, 0x09570, 0x04af5,
															   0x04970, 0x064b0, 0x074a3, 0x0ea50, 0x06b58, 0x055c0, 0x0ab60, 0x096d5, 0x092e0, 0x0c960, 0x0d954, 0x0d4a0,
															   0x0da50, 0x07552, 0x056a0, 0x0abb7, 0x025d0, 0x092d0, 0x0cab5, 0x0a950, 0x0b4a0, 0x0baa4, 0x0ad50, 0x055d9,
															   0x04ba0, 0x0a5b0, 0x15176, 0x052b0, 0x0a930, 0x07954, 0x06aa0, 0x0ad50, 0x05b52, 0x04b60, 0x0a6e6, 0x0a4e0,
															   0x0d260, 0x0ea65, 0x0d530, 0x05aa0, 0x076a3, 0x096d0, 0x04bd7, 0x04ad0, 0x0a4d0, 0x1d0b6, 0x0d250, 0x0d520,
															   0x0dd45, 0x0b5a0, 0x056d0, 0x055b2, 0x049b0, 0x0a577, 0x0a4b0, 0x0aa50, 0x1b255, 0x06d20, 0x0ada0 };

        private static int[] year20 = new int[] { 1, 4, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1 };
        private static int[] year19 = new int[] { 0, 3, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0 };
        private static int[] year2000 = new int[] { 0, 3, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1 };
        private static String[] nStr1 = new String[] { "", "¥¿", "¤G", "¤T", "¥|", "¤­", "¤»", "¤C", "¤K", "¤E", "¤Q", "¤Q¤@", "¤Q¤G" };
        private static String[] Gan = new String[] { "¥Ò", "¤A", "¤þ", "¤B", "¥³", "¤v", "©°", "¨¯", "¤Ð", "¬Ñ" };
        private static String[] Zhi = new String[] { "¤l", "¤¡", "±G", "¥f", "¨°", "¤x", "¤È", "¥¼", "¥Ó", "¨»", "¦¦", "¥è" };
        private static String[] Animals = new String[] { "¹«", "¤û", "ªê", "¨ß", "Às", "³D", "°¨", "¦Ï", "µU", "Âû", "ª¯", "½Þ" };
        private static String[] solarTerm = new String[] { "¤p´H", "¤j´H", "¥ß¬K", "«B¤ô", "Ååîh", "¬K¤À", "²M©ú", "¨¦«B", "¥ß®L", "¤pº¡", "¨~ºØ", "®L¦Ü", "¤p´»", "¤j´»", "¥ß¬î", "³B´»", "¥ÕÅS", "¬î¤À", "´HÅS", "Á÷­°", "¥ß¥V", "¤p³·", "¤j³·", "¥V¦Ü" };
        private static int[] sTermInfo = { 0, 21208, 42467, 63836, 85337, 107014, 128867, 150921, 173149, 195551, 218072, 240693, 263343, 285989, 308563, 331033, 353350, 375494, 397447, 419210, 440795, 462224, 483532, 504758 };
        private static String[] lFtv = new String[] { "0101¹A¾ä¬K¸`", "0202 Às©ïÀY¸`", "0115 ¤¸®d¸`", "0505 ºÝ¤È¸`", "0707 ¤C¤i±¡¤H¸`", "0815 ¤¤¬î¸`", "0909 ­«¶§¸`", "1208 Ã¾¤K¸`", "1114 §õ§g¥ý¥Í¥Í¤é", "1224 ¤p¦~", "0100°£¤i" };
        private static String[] sFtv = new String[] { "0101 ·s¦~¤¸¥¹",
														 "0202 ¥@¬ÉÀã¦a¤é",
														 "0207 °ê»ÚÁn´©«n«D¤é",
														 "0210 °ê»Ú®ð¶H¸`",
														 "0214 ±¡¤H¸`",
														 "0301 °ê»Ú®ü°\¤é",
														 "0303 ¥þ°ê·R¦Õ¤é",
														 "0308 °ê»Ú°ü¤k¸`",
														 "0312 ´Ó¾ð¸` ®]¤¤¤s³u¥@¬ö©À¤é",
														 "0314 °ê»ÚÄµ¹î¤é",
														 "0315 °ê»Ú®ø¶OªÌÅv¯q¤é",
														 "0317 ¤¤°ê°êÂå¸` °ê»Ú¯è®ü¤é",
														 "0321 ¥@¬É´ËªL¤é ®ø°£ºØ±Úª[µø°ê»Ú¤é",
														 "0321 ¥@¬É¨àºq¤é",
														 "0322 ¥@¬É¤ô¤é",
														 "0323 ¥@¬É®ð¶H¤é",
														 "0324 ¥@¬É¨¾ªvµ²®Ö¯f¤é",
														 "0325 ¥þ°ê¤¤¤p¾Ç¥Í¦w¥þ±Ð¨|¤é",
														 "0330 ¤Ú°Ç´µ©Z°ê¤g¤é",
														 "0401 ·M¤H¸` ¥þ°ê·R°ê½Ã¥Í¹B°Ê¤ë(¥|¤ë) µ|¦¬«Å¶Ç¤ë(¥|¤ë)",
														 "0407 ¥@¬É½Ã¥Í¤é",
														 "0422 ¥@¬É¦a²y¤é",
														 "0423 ¥@¬É¹Ï®Ñ©Mª©Åv¤é",
														 "0424 ¨È«D·s»D¤u§@ªÌ¤é",
														 "0501 °ê»Ú³Ò°Ê¸`",
														 "0504 ¤¤°ê¤­¥|«C¦~¸`",
														 "0505 ¸K¯Ê¥F¯f¨¾ªv¤é",
														 "0508 ¥@¬É¬õ¤Q¦r¤é",
														 "0512 °ê»ÚÅ@¤h¸`",
														 "0515 °ê»Ú®a®x¤é",
														 "0517 ¥@¬É¹q«H¤é",
														 "0518 °ê»Ú³Õª«À]¤é",
														 "0520 ¥þ°ê¾Ç¥ÍÀç¾i¤é",
														 "0523 °ê»Ú¤û¥¤¤é",
														 "0531 ¥@¬ÉµL·Ï¤é",
														 "0601 °ê»Ú¨àµ£¸`",
														 "0605 ¥@¬ÉÀô¹Ò¤é",
														 "0606 ¥þ°ê·R²´¤é",
														 "0617 ¨¾ªv¯îºz¤Æ©M°®§ò¤é",
														 "0623 °ê»Ú¶øªL¤Ç«g¤é",
														 "0625 ¥þ°ê¤g¦a¤é",
														 "0626 °ê»Ú¤Ï¬r«~¤é",
														 "0701 ¤¤°ê¦@²£ÄÒ«ØÄÒ¤é ¥@¬É«Ø¿v¤é",
														 "0702 °ê»ÚÅé¨|°OªÌ¤é",
														 "0707 ¤¤°ê¤H¥Á§Ü¤é¾Ôª§¬ö©À¤é",
														 "0711 ¥@¬É¤H¤f¤é",
														 "0730 «D¬w°ü¤k¤é",
														 "0801 ¤¤°ê«Ø­x¸`",
														 "0808 ¤¤°ê¨k¤l¸`(ª¨ª¨¸`)",
														 "0815 ¤é¥»¥¿¦¡«Å§GµL±ø¥ó§ë­°¤é",
														 "0908 °ê»Ú±½ª¼¤é °ê»Ú·s»D¤u§@ªÌ¤é",
														 "0910 ±Ð®v¸`",
														 "0914 ¥@¬É²M¼ä¦a²y¤é",
														 "0916 °ê»Ú¯ä®ñ¼h«OÅ@¤é",
														 "0918 ¤E¡P¤@¤K¨ÆÅÜ¬ö©À¤é",
														 "0920 ¥þ°ê·R¤ú¤é",
														 "0927 ¥@¬É®È¹C¤é",
														 "1001 °ê¼y¸` ¥@¬É­µ¼Ö¤é °ê»Ú¦Ñ¤H¸`",
														 "1001 °ê»Ú­µ¼Ö¤é",
														 "1002 °ê»Ú©M¥­»P¥Á¥D¦Û¥Ñ°«ª§¤é",
														 "1004 ¥@¬É°Êª«¤é",
														 "1008 ¥þ°ê°ª¦åÀ£¤é",
														 "1008 ¥@¬ÉµøÄ±¤é",
														 "1009 ¥@¬É¶l¬F¤é ¸U°ê¶lÁp¤é",
														 "1010 ¨¯¥è­²©R¬ö©À¤é ¥@¬Éºë¯«½Ã¥Í¤é",
														 "1013 ¥@¬É«O°·¤é °ê»Ú±Ð®v¸`",
														 "1014 ¥@¬É¼Ð·Ç¤é",
														 "1015 °ê»Úª¼¤H¸`(¥Õ¤â§ú¸`)",
														 "1016 ¥@¬ÉÂ³­¹¤é",
														 "1017 ¥@¬É®ø°£³h§x¤é",
														 "1022 ¥@¬É¶Ç²ÎÂåÃÄ¤é",
														 "1024 Áp¦X°ê¤é ¥@¬Éµo®i«H®§¤é",
														 "1031 ¥@¬É¶Ô»ü¤é",
														 "1107 ¤Q¤ëªÀ·|¥D¸q­²©R¬ö©À¤é",
														 "1108 ¤¤°ê°OªÌ¤é",
														 "1109 ¥þ°ê®ø¨¾¦w¥þ«Å¶Ç±Ð¨|¤é",
														 "1110 ¥@¬É«C¦~¸`",
														 "1111 °ê»Ú¬ì¾Ç»P©M¥­©P(¥»¤é©ÒÄÝªº¤@©P)",
														 "1112 ®]¤¤¤s½Ï¨°¬ö©À¤é",
														 "1114 ¥@¬É¿}§¿¯f¤é",
														 "1117 °ê»Ú¤j¾Ç¥Í¸` ¥@¬É¾Ç¥Í¸`",
														 "1121 ¥@¬É°Ý­Ô¤é ¥@¬É¹qµø¤é",
														 "1129 °ê»ÚÁn´©¤Ú°Ç´µ©Z¤H¥Á°ê»Ú¤é",
														 "1201 ¥@¬É¦ã´þ¯f¤é",
														 "1203 ¥@¬É´Ý¯e¤H¤é",
														 "1205 °ê»Ú¸gÀÙ©MªÀ·|µo®i§ÓÄ@¤H­û¤é",
														 "1208 °ê»Ú¨àµ£¹qµø¤é",
														 "1209 ¥@¬É¨¬²y¤é",
														 "1210 ¥@¬É¤HÅv¤é",
														 "1212 ¦è¦w¨ÆÅÜ¬ö©À¤é",
														 "1213 «n¨Ê¤j±O±þ(1937¦~)¬ö©À¤é¡Iºò°O¦å²\¥v¡I",
														 "1221 °ê»ÚÄx²y¤é",
														 "1224 ¥­¦w©]",
														 "1225 ¸t½Ï¸`",
														 "1226 ¤ò¥D®u½Ï¨°",
														 "1229 °ê»Ú¥Íª«¦h¼Ë©Ê¤é" };


        /// <summary>
        /// ¶Ç¦^¹A¾äy¦~ªºÁ`¤Ñ¼Æ
        /// </summary>
        private static int lYearDays(int y)
        {
            int i, sum = 348;
            for (i = 0x8000; i > 0x8; i >>= 1)
            {
                if ((lunarInfo[y - 1900] & i) != 0)
                    sum += 1;
            }
            return (sum + leapDays(y));
        }

        /// <summary>
        /// ¶Ç¦^¹A¾äy¦~¶|¤ëªº¤Ñ¼Æ
        /// </summary>
        private static int leapDays(int y)
        {
            if (leapMonth(y) != 0)
            {
                if ((lunarInfo[y - 1900] & 0x10000) != 0)
                    return 30;
                else
                    return 29;
            }
            else
                return 0;
        }

        /// <summary>
        /// ¶Ç¦^¹A¾äy¦~¶|­þ­Ó¤ë 1-12 , ¨S¶|¶Ç¦^ 0
        /// </summary>
        private static int leapMonth(int y)
        {
            return (int)(lunarInfo[y - 1900] & 0xf);
        }

        /// <summary>
        /// ¶Ç¦^¹A¾äy¦~m¤ëªºÁ`¤Ñ¼Æ
        /// </summary>
        private static int monthDays(int y, int m)
        {
            if ((lunarInfo[y - 1900] & (0x10000 >> m)) == 0)
                return 29;
            else
                return 30;
        }

        /// <summary>
        /// ¶Ç¦^¹A¾äy¦~ªº¥Í¨v
        /// </summary>
        private static String AnimalsYear(int y)
        {
            return Animals[(y - 4) % 12];
        }

        /// <summary>
        /// ¶Ç¤J¤ë¤éªºoffset ¶Ç¦^¤z¤ä,0=¥Ò¤l
        /// </summary>
        private static String cyclicalm(int num)
        {
            return (Gan[num % 10] + Zhi[num % 12]);
        }

        /// <summary>
        /// ¶Ç¤Joffset ¶Ç¦^¤z¤ä, 0=¥Ò¤l
        /// </summary>
        private static String cyclical(int y)
        {
            int num = y - 1900 + 36;
            return (cyclicalm(num));
        }

        /// <summary>
        /// ¶Ç¥X¹A¾ä.year0 .month1 .day2 .yearCyl3 .monCyl4 .dayCyl5 .isLeap6
        /// </summary>
        private long[] Lunar(int y, int m)
        {
            long[] nongDate = new long[7];
            int i = 0, temp = 0, leap = 0;
            DateTime baseDate = new DateTime(1900 + 1900, 2, 31);
            DateTime objDate = new DateTime(y + 1900, m + 1, 1);
            TimeSpan ts = objDate - baseDate;
            long offset = (long)ts.TotalDays;
            if (y < 2000)
                offset += year19[m - 1];
            if (y > 2000)
                offset += year20[m - 1];
            if (y == 2000)
                offset += year2000[m - 1];
            nongDate[5] = offset + 40;
            nongDate[4] = 14;

            for (i = 1900; i < 2050 && offset > 0; i++)
            {
                temp = lYearDays(i);
                offset -= temp;
                nongDate[4] += 12;
            }
            if (offset < 0)
            {
                offset += temp;
                i--;
                nongDate[4] -= 12;
            }
            nongDate[0] = i;
            nongDate[3] = i - 1864;
            leap = leapMonth(i); // ¶|­þ­Ó¤ë
            nongDate[6] = 0;

            for (i = 1; i < 13 && offset > 0; i++)
            {
                // ¶|¤ë
                if (leap > 0 && i == (leap + 1) && nongDate[6] == 0)
                {
                    --i;
                    nongDate[6] = 1;
                    temp = leapDays((int)nongDate[0]);
                }
                else
                {
                    temp = monthDays((int)nongDate[0], i);
                }

                // ¸Ñ°£¶|¤ë
                if (nongDate[6] == 1 && i == (leap + 1))
                    nongDate[6] = 0;
                offset -= temp;
                if (nongDate[6] == 0)
                    nongDate[4]++;
            }

            if (offset == 0 && leap > 0 && i == leap + 1)
            {
                if (nongDate[6] == 1)
                {
                    nongDate[6] = 0;
                }
                else
                {
                    nongDate[6] = 1;
                    --i;
                    --nongDate[4];
                }
            }
            if (offset < 0)
            {
                offset += temp;
                --i;
                --nongDate[4];
            }
            nongDate[1] = i;
            nongDate[2] = offset + 1;
            return nongDate;
        }

        /// <summary>
        /// ¶Ç¥Xy¦~m¤ëd¤é¹ïÀ³ªº¹A¾ä.year0 .month1 .day2 .yearCyl3 .monCyl4 .dayCyl5 .isLeap6
        /// </summary>
        private static long[] calElement(int y, int m, int d)
        {
            long[] nongDate = new long[7];
            int i = 0, temp = 0, leap = 0;

            DateTime baseDate = new DateTime(1900, 1, 31);

            DateTime objDate = new DateTime(y, m, d);
            TimeSpan ts = objDate - baseDate;

            long offset = (long)ts.TotalDays;

            nongDate[5] = offset + 40;
            nongDate[4] = 14;

            for (i = 1900; i < 2050 && offset > 0; i++)
            {
                temp = lYearDays(i);
                offset -= temp;
                nongDate[4] += 12;
            }
            if (offset < 0)
            {
                offset += temp;
                i--;
                nongDate[4] -= 12;
            }
            nongDate[0] = i;
            nongDate[3] = i - 1864;
            leap = leapMonth(i); // ¶|­þ­Ó¤ë
            nongDate[6] = 0;

            for (i = 1; i < 13 && offset > 0; i++)
            {
                // ¶|¤ë
                if (leap > 0 && i == (leap + 1) && nongDate[6] == 0)
                {
                    --i;
                    nongDate[6] = 1;
                    temp = leapDays((int)nongDate[0]);
                }
                else
                {
                    temp = monthDays((int)nongDate[0], i);
                }

                // ¸Ñ°£¶|¤ë
                if (nongDate[6] == 1 && i == (leap + 1))
                    nongDate[6] = 0;
                offset -= temp;
                if (nongDate[6] == 0)
                    nongDate[4]++;
            }

            if (offset == 0 && leap > 0 && i == leap + 1)
            {
                if (nongDate[6] == 1)
                {
                    nongDate[6] = 0;
                }
                else
                {
                    nongDate[6] = 1;
                    --i;
                    --nongDate[4];
                }
            }
            if (offset < 0)
            {
                offset += temp;
                --i;
                --nongDate[4];
            }
            nongDate[1] = i;
            nongDate[2] = offset + 1;
            return nongDate;
        }

        private static String getChinaDate(int day)
        {
            String a = "";
            if (day == 10)
                return "ªì¤Q";
            if (day == 20)
                return "¤G¤Q";
            if (day == 30)
                return "¤T¤Q";
            int two = (int)((day) / 10);
            if (two == 0)
                a = "ªì";
            if (two == 1)
                a = "¤Q";
            if (two == 2)
                a = "¤Ü";
            if (two == 3)
                a = "¤T";
            int one = (int)(day % 10);
            switch (one)
            {
                case 1:
                    a += "¤@";
                    break;
                case 2:
                    a += "¤G";
                    break;
                case 3:
                    a += "¤T";
                    break;
                case 4:
                    a += "¥|";
                    break;
                case 5:
                    a += "¤­";
                    break;
                case 6:
                    a += "¤»";
                    break;
                case 7:
                    a += "¤C";
                    break;
                case 8:
                    a += "¤K";
                    break;
                case 9:
                    a += "¤E";
                    break;
            }
            return a;
        }

        private static DateTime sTerm(int y, int n)
        {
            double ms = 31556925974.7 * (y - 1900);
            double ms1 = sTermInfo[n];
            DateTime offDate = new DateTime(1900, 1, 6, 2, 5, 0);
            offDate = offDate.AddMilliseconds(ms);
            offDate = offDate.AddMinutes(ms1);
            return offDate;
        }

        static string FormatDate(int m, int d)
        {
            return string.Format("{0:00}{1:00}", m, d);
        }
        #endregion

        #region ¤½¦³¤èªk
        /// <summary>
        /// ¶Ç¦^¤½¾úy¦~m¤ëªºÁ`¤Ñ¼Æ
        /// </summary>
        public static int GetDaysByMonth(int y, int m)
        {
            int[] days = new int[] { 31, DateTime.IsLeapYear(y) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
            return days[m - 1];
        }

        /// <summary>
        /// ®Ú¾Ú¤é´Á­ÈÀò±o¶g¤@ªº¤é´Á
        /// </summary>
        /// <param name="dt">¿é¤J¤é´Á</param>
        /// <returns>¶g¤@ªº¤é´Á</returns>
        public static DateTime GetMondayDateByDate(DateTime dt)
        {
            double d = 0;
            switch ((int)dt.DayOfWeek)
            {
                //case 1: d = 0; break;
                case 2: d = -1; break;
                case 3: d = -2; break;
                case 4: d = -3; break;
                case 5: d = -4; break;
                case 6: d = -5; break;
                case 0: d = -6; break;
            }
            return dt.AddDays(d);
        }

        /// <summary>
        /// Àò¨ú¹A¾ä
        /// </summary>
        public static CNDate getChinaDate(DateTime dt)
        {
            CNDate cd = new CNDate();
            int year = dt.Year;
            int month = dt.Month;
            int date = dt.Day;
            long[] l = calElement(year, month, date);
            cd.cnIntYear = (int)l[0];
            cd.cnIntMonth = (int)l[1];
            cd.cnIntDay = (int)l[2];
            cd.cnStrYear = cyclical(year);
            cd.cnAnm = AnimalsYear(year);
            cd.cnStrMonth = nStr1[(int)l[1]];
            cd.cnStrDay = getChinaDate((int)(l[2]));
            string smd = dt.ToString("MMdd");

            string lmd = FormatDate(cd.cnIntMonth, cd.cnIntDay);
            for (int i = 0; i < solarTerm.Length; i++)
            {
                string s1 = sTerm(dt.Year, i).ToString("MMdd");
                if (s1.Equals(dt.ToString("MMdd")))
                {
                    cd.cnSolarTerm = solarTerm[i];
                    break;
                }
            }
            foreach (string s in sFtv)
            {
                string s1 = s.Substring(0, 4);
                if (s1.Equals(smd))
                {
                    cd.cnFtvs = s.Substring(4, s.Length - 4);
                    break;
                }
            }
            foreach (string s in lFtv)
            {
                string s1 = s.Substring(0, 4);
                if (s1.Equals(lmd))
                {
                    cd.cnFtvl = s.Substring(4, s.Length - 4);
                    break;
                }
            }
            dt = dt.AddDays(1);
            year = dt.Year;
            month = dt.Month;
            date = dt.Day;
            l = calElement(year, month, date);
            lmd = FormatDate((int)l[1], (int)l[2]);
            if (lmd.Equals("0101")) cd.cnFtvl = "°£¤i";
            return cd;
        }
        #endregion
    }

    /// <summary>
    /// ¤¤°ê¤é¾ä
    /// </summary>
    //-------------------------------------------------------------------------------
    //½Õ¥Î:
    //ChineseCalendar c = new ChineseCalendar(new DateTime(1990, 01, 15));
    //StringBuilder dayInfo = new StringBuilder();
    //dayInfo.Append("¶§¾ä¡G" + c.DateString + "\r\n");
    //dayInfo.Append("¹A¾ä¡G" + c.ChineseDateString + "\r\n");
    //dayInfo.Append("¬P´Á¡G" + c.WeekDayStr);
    //dayInfo.Append("®É¨°¡G" + c.ChineseHour + "\r\n");
    //dayInfo.Append("ÄÝ¬Û¡G" + c.AnimalString + "\r\n");
    //dayInfo.Append("¸`®ð¡G" + c.ChineseTwentyFourDay + "\r\n");
    //dayInfo.Append("«e¤@­Ó¸`®ð¡G" + c.ChineseTwentyFourPrevDay + "\r\n");
    //dayInfo.Append("¤U¤@­Ó¸`®ð¡G" + c.ChineseTwentyFourNextDay + "\r\n");
    //dayInfo.Append("¸`¤é¡G" + c.DateHoliday + "\r\n");
    //dayInfo.Append("¤z¤ä¡G" + c.GanZhiDateString + "\r\n");
    //dayInfo.Append("¬P±J¡G" + c.ChineseConstellation + "\r\n");
    //dayInfo.Append("¬P®y¡G" + c.Constellation + "\r\n");
    //-------------------------------------------------------------------------------
    public class ChineseCalendar
    {
        #region ¤º³¡µ²ºc
        /// <summary>
        /// ¶§¾ä
        /// </summary>
        private struct SolarHolidayStruct
        {
            public int Month;
            public int Day;
            public int Recess; //°²´Áªø«×
            public string HolidayName;
            public SolarHolidayStruct(int month, int day, int recess, string name)
            {
                Month = month;
                Day = day;
                Recess = recess;
                HolidayName = name;
            }
        }

        /// <summary>
        /// ¹A¾ä
        /// </summary>
        private struct LunarHolidayStruct
        {
            public int Month;
            public int Day;
            public int Recess;
            public string HolidayName;

            public LunarHolidayStruct(int month, int day, int recess, string name)
            {
                Month = month;
                Day = day;
                Recess = recess;
                HolidayName = name;
            }
        }

        private struct WeekHolidayStruct
        {
            public int Month;
            public int WeekAtMonth;
            public int WeekDay;
            public string HolidayName;

            public WeekHolidayStruct(int month, int weekAtMonth, int weekDay, string name)
            {
                Month = month;
                WeekAtMonth = weekAtMonth;
                WeekDay = weekDay;
                HolidayName = name;
            }
        }
        #endregion

        #region ¤º³¡ÅÜ¶q
        private DateTime _date;
        private DateTime _datetime;
        private int _cYear;
        private int _cMonth;
        private int _cDay;
        private bool _cIsLeapMonth; //·í¤ë¬O§_¶|¤ë
        private bool _cIsLeapYear;  //·í¦~¬O§_¦³¶|¤ë
        #endregion

        #region °òÂ¦¼Æ¾Ú
        #region °ò¥»±`¶q
        private const int MinYear = 1900;
        private const int MaxYear = 2050;
        private static DateTime MinDay = new DateTime(1900, 1, 30);
        private static DateTime MaxDay = new DateTime(2049, 12, 31);
        private const int GanZhiStartYear = 1864; //¤z¤ä­pºâ°_©l¦~
        private static DateTime GanZhiStartDay = new DateTime(1899, 12, 22);//°_©l¤é
        private const string HZNum = "¹s¤@¤G¤T¥|¤­¤»¤C¤K¤E";
        private const int AnimalStartYear = 1900; //1900¦~¬°¹«¦~
        private static DateTime ChineseConstellationReferDay = new DateTime(2007, 9, 13);//28¬P±J°Ñ¦Ò­È,¥»¤é¬°¨¤
        #endregion

        #region ³±¾ä¼Æ¾Ú
        /// <summary>
        /// ¨Ó·½©óºô¤Wªº¹A¾ä¼Æ¾Ú
        /// </summary>
        /// <remarks>
        /// ¼Æ¾Úµ²ºc¦p¤U¡A¦@¨Ï¥Î17¦ì¼Æ¾Ú
        /// ²Ä17¦ì¡Gªí¥Ü¶|¤ë¤Ñ¼Æ¡A0ªí¥Ü29¤Ñ   1ªí¥Ü30¤Ñ
        /// ²Ä16¦ì-²Ä5¦ì¡]¦@12¦ì¡^ªí¥Ü12­Ó¤ë¡A¨ä¤¤²Ä16¦ìªí¥Ü²Ä¤@¤ë¡A¦pªG¸Ó¤ë¬°30¤Ñ«h¬°1¡A29¤Ñ¬°0
        /// ²Ä4¦ì-²Ä1¦ì¡]¦@4¦ì¡^ªí¥Ü¶|¤ë¬O­þ­Ó¤ë¡A¦pªG·í¦~¨S¦³¶|¤ë¡A«h¸m0
        ///</remarks>
        private static int[] LunarDateArray = new int[]{
                0x04BD8,0x04AE0,0x0A570,0x054D5,0x0D260,0x0D950,0x16554,0x056A0,0x09AD0,0x055D2,
                0x04AE0,0x0A5B6,0x0A4D0,0x0D250,0x1D255,0x0B540,0x0D6A0,0x0ADA2,0x095B0,0x14977,
                0x04970,0x0A4B0,0x0B4B5,0x06A50,0x06D40,0x1AB54,0x02B60,0x09570,0x052F2,0x04970,
                0x06566,0x0D4A0,0x0EA50,0x06E95,0x05AD0,0x02B60,0x186E3,0x092E0,0x1C8D7,0x0C950,
                0x0D4A0,0x1D8A6,0x0B550,0x056A0,0x1A5B4,0x025D0,0x092D0,0x0D2B2,0x0A950,0x0B557,
                0x06CA0,0x0B550,0x15355,0x04DA0,0x0A5B0,0x14573,0x052B0,0x0A9A8,0x0E950,0x06AA0,
                0x0AEA6,0x0AB50,0x04B60,0x0AAE4,0x0A570,0x05260,0x0F263,0x0D950,0x05B57,0x056A0,
                0x096D0,0x04DD5,0x04AD0,0x0A4D0,0x0D4D4,0x0D250,0x0D558,0x0B540,0x0B6A0,0x195A6,
                0x095B0,0x049B0,0x0A974,0x0A4B0,0x0B27A,0x06A50,0x06D40,0x0AF46,0x0AB60,0x09570,
                0x04AF5,0x04970,0x064B0,0x074A3,0x0EA50,0x06B58,0x055C0,0x0AB60,0x096D5,0x092E0,
                0x0C960,0x0D954,0x0D4A0,0x0DA50,0x07552,0x056A0,0x0ABB7,0x025D0,0x092D0,0x0CAB5,
                0x0A950,0x0B4A0,0x0BAA4,0x0AD50,0x055D9,0x04BA0,0x0A5B0,0x15176,0x052B0,0x0A930,
                0x07954,0x06AA0,0x0AD50,0x05B52,0x04B60,0x0A6E6,0x0A4E0,0x0D260,0x0EA65,0x0D530,
                0x05AA0,0x076A3,0x096D0,0x04BD7,0x04AD0,0x0A4D0,0x1D0B6,0x0D250,0x0D520,0x0DD45,
                0x0B5A0,0x056D0,0x055B2,0x049B0,0x0A577,0x0A4B0,0x0AA50,0x1B255,0x06D20,0x0ADA0,
                0x14B63        
                };

        #endregion

        #region ¬P®y¦WºÙ
        private static string[] _constellationName = 
                { 
                    "¥Õ¦Ï®y", "ª÷¤û®y", "Âù¤l®y", 
                    "¥¨ÃÉ®y", "·à¤l®y", "³B¤k®y", 
                    "¤Ñ¯¯®y", "¤ÑÃÈ®y", "®g¤â®y", 
                    "¼¯½~®y", "¤ô²~®y", "Âù³½®y"
                };
        #endregion

        #region ¤G¤Q¥|¸`®ð
        private static string[] _lunarHolidayName = 
                    { 
                    "¤p´H", "¤j´H", "¥ß¬K", "«B¤ô", 
                    "Ååîh", "¬K¤À", "²M©ú", "¨¦«B", 
                    "¥ß®L", "¤pº¡", "¨~ºØ", "®L¦Ü", 
                    "¤p´»", "¤j´»", "¥ß¬î", "³B´»", 
                    "¥ÕÅS", "¬î¤À", "´HÅS", "Á÷­°", 
                    "¥ß¥V", "¤p³·", "¤j³·", "¥V¦Ü"
                    };
        #endregion

        #region ¤G¤Q¤K¬P±J
        private static string[] _chineseConstellationName =
            {
                  //¥|        ¤­      ¤»         ¤é        ¤@      ¤G      ¤T  
                "¨¤¤ìµë","¤®ª÷Às","¤k¤g½»","©Ð¤é¨ß","¤ß¤ëª°","§À¤õªê","ºß¤ô°\",
                "¤æ¤ìê^","¤ûª÷¤û","¥Â¤g¸è","µê¤é¹«","¦M¤ë¿P","«Ç¤õ½Þ","¾À¤ôæz",
                "«¶¤ì¯T","°úª÷ª¯","­G¤gØô","Îö¤éÂû","²¦¤ë¯Q","àC¤õµU","°Ñ¤ô·á",
                "¤«¤ìÊC","°­ª÷¦Ï","¬h¤gº¼","¬P¤é°¨","±i¤ë³À","Ál¤õ³D","ÜH¤ô°C" 
            };
        #endregion

        #region ¸`®ð¼Æ¾Ú
        private static string[] SolarTerm = new string[] { "¤p´H", "¤j´H", "¥ß¬K", "«B¤ô", "Ååîh", "¬K¤À", "²M©ú", "¨¦«B", "¥ß®L", "¤pº¡", "¨~ºØ", "®L¦Ü", "¤p´»", "¤j´»", "¥ß¬î", "³B´»", "¥ÕÅS", "¬î¤À", "´HÅS", "Á÷­°", "¥ß¥V", "¤p³·", "¤j³·", "¥V¦Ü" };
        private static int[] sTermInfo = new int[] { 0, 21208, 42467, 63836, 85337, 107014, 128867, 150921, 173149, 195551, 218072, 240693, 263343, 285989, 308563, 331033, 353350, 375494, 397447, 419210, 440795, 462224, 483532, 504758 };
        #endregion

        #region ¹A¾ä¬ÛÃö¼Æ¾Ú
        private static string ganStr = "¥Ò¤A¤þ¤B¥³¤v©°¨¯¤Ð¬Ñ";
        private static string zhiStr = "¤l¤¡±G¥f¨°¤x¤È¥¼¥Ó¨»¦¦¥è";
        private static string animalStr = "¹«¤ûªê¨ßÀs³D°¨¦ÏµUÂûª¯½Þ";
        private static string nStr1 = "¤é¤@¤G¤T¥|¤­¤»¤C¤K¤E";
        private static string nStr2 = "ªì¤Q¤Ü¤Ê";
        private static string[] _monthString =
                {
                    "¥X¿ù","¥¿¤ë","¤G¤ë","¤T¤ë","¥|¤ë","¤­¤ë","¤»¤ë","¤C¤ë","¤K¤ë","¤E¤ë","¤Q¤ë","¤Q¤@¤ë","Ã¾¤ë"
                };
        #endregion

        #region «ö¤½¾ú­pºâªº¸`¤é
        private static SolarHolidayStruct[] sHolidayInfo = new SolarHolidayStruct[]{
            new SolarHolidayStruct(1, 1, 1, "¤¸¥¹"),
            new SolarHolidayStruct(2, 2, 0, "¥@¬ÉÀã¦a¤é"),
            new SolarHolidayStruct(2, 10, 0, "°ê»Ú®ð¶H¸`"),
            new SolarHolidayStruct(2, 14, 0, "±¡¤H¸`"),
            new SolarHolidayStruct(3, 1, 0, "°ê»Ú®ü°\¤é"),
            new SolarHolidayStruct(3, 5, 0, "¾Ç¹p¾W¬ö©À¤é"),
            new SolarHolidayStruct(3, 8, 0, "°ü¤k¸`"), 
            new SolarHolidayStruct(3, 12, 0, "´Ó¾ð¸` ®]¤¤¤s³u¥@¬ö©À¤é"), 
            new SolarHolidayStruct(3, 14, 0, "°ê»ÚÄµ¹î¤é"),
            new SolarHolidayStruct(3, 15, 0, "®ø¶OªÌÅv¯q¤é"),
            new SolarHolidayStruct(3, 17, 0, "¤¤°ê°êÂå¸` °ê»Ú¯è®ü¤é"),
            new SolarHolidayStruct(3, 21, 0, "¥@¬É´ËªL¤é ®ø°£ºØ±Úª[µø°ê»Ú¤é ¥@¬É¨àºq¤é"),
            new SolarHolidayStruct(3, 22, 0, "¥@¬É¤ô¤é"),
            new SolarHolidayStruct(3, 24, 0, "¥@¬É¨¾ªvµ²®Ö¯f¤é"),
            new SolarHolidayStruct(4, 1, 0, "·M¤H¸`"),
            new SolarHolidayStruct(4, 7, 0, "¥@¬É½Ã¥Í¤é"),
            new SolarHolidayStruct(4, 22, 0, "¥@¬É¦a²y¤é"),
            new SolarHolidayStruct(5, 1, 1, "³Ò°Ê¸`"), 
            new SolarHolidayStruct(5, 2, 1, "³Ò°Ê¸`°²¤é"),
            new SolarHolidayStruct(5, 3, 1, "³Ò°Ê¸`°²¤é"),
            new SolarHolidayStruct(5, 4, 0, "«C¦~¸`"), 
            new SolarHolidayStruct(5, 8, 0, "¥@¬É¬õ¤Q¦r¤é"),
            new SolarHolidayStruct(5, 12, 0, "°ê»ÚÅ@¤h¸`"), 
            new SolarHolidayStruct(5, 31, 0, "¥@¬ÉµL·Ï¤é"), 
            new SolarHolidayStruct(6, 1, 0, "°ê»Ú¨àµ£¸`"), 
            new SolarHolidayStruct(6, 5, 0, "¥@¬ÉÀô¹Ò«OÅ@¤é"),
            new SolarHolidayStruct(6, 26, 0, "°ê»Ú¸T¬r¤é"),
            new SolarHolidayStruct(7, 1, 0, "«ØÄÒ¸` ­»´ä¦^Âk¬ö©À ¥@¬É«Ø¿v¤é"),
            new SolarHolidayStruct(7, 11, 0, "¥@¬É¤H¤f¤é"),
            new SolarHolidayStruct(8, 1, 0, "«Ø­x¸`"), 
            new SolarHolidayStruct(8, 8, 0, "¤¤°ê¨k¤l¸` ¤÷¿Ë¸`"),
            new SolarHolidayStruct(8, 15, 0, "§Ü¤é¾Ôª§³Ó§Q¬ö©À"),
            new SolarHolidayStruct(9, 9, 0, "¤ò¥D®u³u¥@¬ö©À"), 
            new SolarHolidayStruct(9, 10, 0, "±Ð®v¸`"), 
            new SolarHolidayStruct(9, 18, 0, "¤E¡P¤@¤K¨ÆÅÜ¬ö©À¤é"),
            new SolarHolidayStruct(9, 20, 0, "°ê»Ú·R¤ú¤é"),
            new SolarHolidayStruct(9, 27, 0, "¥@¬É®È¹C¤é"),
            new SolarHolidayStruct(9, 28, 0, "¤Õ¤l½Ï¨°"),
            new SolarHolidayStruct(10, 1, 1, "°ê¼y¸` °ê»Ú­µ¼Ö¤é"),
            new SolarHolidayStruct(10, 2, 1, "°ê¼y¸`°²¤é"),
            new SolarHolidayStruct(10, 3, 1, "°ê¼y¸`°²¤é"),
            new SolarHolidayStruct(10, 6, 0, "¦Ñ¤H¸`"), 
            new SolarHolidayStruct(10, 24, 0, "Áp¦X°ê¤é"),
            new SolarHolidayStruct(11, 10, 0, "¥@¬É«C¦~¸`"),
            new SolarHolidayStruct(11, 12, 0, "®]¤¤¤s½Ï¨°¬ö©À"), 
            new SolarHolidayStruct(12, 1, 0, "¥@¬É¦ã´þ¯f¤é"), 
            new SolarHolidayStruct(12, 3, 0, "¥@¬É´Ý¯e¤H¤é"), 
            new SolarHolidayStruct(12, 20, 0, "¿Dªù¦^Âk¬ö©À"), 
            new SolarHolidayStruct(12, 24, 0, "¥­¦w©]"), 
            new SolarHolidayStruct(12, 25, 0, "¸t½Ï¸`"), 
            new SolarHolidayStruct(12, 26, 0, "¤ò¥D®u½Ï¨°¬ö©À")
           };
        #endregion

        #region «ö¹A¾ä­pºâªº¸`¤é
        private static LunarHolidayStruct[] lHolidayInfo = new LunarHolidayStruct[]{
            new LunarHolidayStruct(1, 1, 1, "¬K¸`"), 
            new LunarHolidayStruct(1, 15, 0, "¤¸®d¸`"), 
            new LunarHolidayStruct(5, 5, 0, "ºÝ¤È¸`"), 
            new LunarHolidayStruct(7, 7, 0, "¤C¤i±¡¤H¸`"),
            new LunarHolidayStruct(7, 15, 0, "¤¤¤¸¸` ª»Äõ¬Ö¸`"), 
            new LunarHolidayStruct(8, 15, 0, "¤¤¬î¸`"), 
            new LunarHolidayStruct(9, 9, 0, "­«¶§¸`"), 
            new LunarHolidayStruct(12, 8, 0, "Ã¾¤K¸`"),
            new LunarHolidayStruct(12, 23, 0, "¥_¤è¤p¦~(±½©Ð)"),
            new LunarHolidayStruct(12, 24, 0, "«n¤è¤p¦~(å¸¹Ð)"),
            //new LunarHolidayStruct(12, 30, 0, "°£¤i")  //ª`·N°£¤i»Ý­n¨ä¥¦¤èªk¶i¦æ­pºâ
        };
        #endregion

        #region «ö¬Y¤ë²Ä´X­Ó¬P´Á´X
        private static WeekHolidayStruct[] wHolidayInfo = new WeekHolidayStruct[]{
            new WeekHolidayStruct(5, 2, 1, "¥À¿Ë¸`"), 
            new WeekHolidayStruct(5, 3, 1, "¥þ°ê§U´Ý¤é"), 
            new WeekHolidayStruct(6, 3, 1, "¤÷¿Ë¸`"), 
            new WeekHolidayStruct(9, 3, 3, "°ê»Ú©M¥­¤é"), 
            new WeekHolidayStruct(9, 4, 1, "°ê»ÚÅ¤¤H¸`"), 
            new WeekHolidayStruct(10, 1, 2, "°ê»Ú¦í©Ð¤é"), 
            new WeekHolidayStruct(10, 1, 4, "°ê»Ú´î»´¦ÛµM¨a®`¤é"),
            new WeekHolidayStruct(11, 4, 5, "·P®¦¸`")
        };
        #endregion
        #endregion

        #region ºc³y¨ç¼Æ
        #region ¤½¾ú¤é´Áªì©l¤Æ
        /// <summary>
        /// ¥Î¤@­Ó¼Ð·Çªº¤½¾ú¤é´Á¨Óªì¨Ï¤Æ
        /// </summary>
        public ChineseCalendar(DateTime dt)
        {
            int i;
            int leap;
            int temp;
            int offset;

            CheckDateLimit(dt);

            _date = dt.Date;
            _datetime = dt;

            //¹A¾ä¤é´Á­pºâ³¡¤À
            leap = 0;
            temp = 0;

            //­pºâ¨â¤Ñªº°ò¥»®t¶Z
            TimeSpan ts = _date - ChineseCalendar.MinDay;
            offset = ts.Days;

            for (i = MinYear; i <= MaxYear; i++)
            {
                //¨D·í¦~¹A¾ä¦~¤Ñ¼Æ
                temp = GetChineseYearDays(i);
                if (offset - temp < 1)
                    break;
                else
                {
                    offset = offset - temp;
                }
            }
            _cYear = i;

            //­pºâ¸Ó¦~¶|­þ­Ó¤ë
            leap = GetChineseLeapMonth(_cYear);

            //³]©w·í¦~¬O§_¦³¶|¤ë
            if (leap > 0)
            {
                _cIsLeapYear = true;
            }
            else
            {
                _cIsLeapYear = false;
            }

            _cIsLeapMonth = false;
            for (i = 1; i <= 12; i++)
            {
                //¶|¤ë
                if ((leap > 0) && (i == leap + 1) && (_cIsLeapMonth == false))
                {
                    _cIsLeapMonth = true;
                    i = i - 1;
                    temp = GetChineseLeapMonthDays(_cYear); //­pºâ¶|¤ë¤Ñ¼Æ
                }
                else
                {
                    _cIsLeapMonth = false;
                    temp = GetChineseMonthDays(_cYear, i);  //­pºâ«D¶|¤ë¤Ñ¼Æ
                }

                offset = offset - temp;
                if (offset <= 0) break;
            }

            offset = offset + temp;
            _cMonth = i;
            _cDay = offset;
        }
        #endregion

        #region ¹A¾ä¤é´Áªì©l¤Æ
        /// <summary>
        /// ¥Î¹A¾äªº¤é´Á¨Óªì¨Ï¤Æ
        /// </summary>
        /// <param name="cy">¹A¾ä¦~</param>
        /// <param name="cm">¹A¾ä¤ë</param>
        /// <param name="cd">¹A¾ä¤é</param>
        /// <param name="LeapFlag">¶|¤ë¼Ð»x</param>
        public ChineseCalendar(int cy, int cm, int cd, bool leapMonthFlag)
        {
            int i, leap, Temp, offset;

            CheckChineseDateLimit(cy, cm, cd, leapMonthFlag);

            _cYear = cy;
            _cMonth = cm;
            _cDay = cd;

            offset = 0;

            for (i = MinYear; i < cy; i++)
            {
                //¨D·í¦~¹A¾ä¦~¤Ñ¼Æ
                Temp = GetChineseYearDays(i);
                offset = offset + Temp;
            }

            //­pºâ¸Ó¦~À³¸Ó¶|­þ­Ó¤ë
            leap = GetChineseLeapMonth(cy);
            if (leap != 0)
            {
                this._cIsLeapYear = true;
            }
            else
            {
                this._cIsLeapYear = false;
            }

            if (cm != leap)
            {
                //·í«e¤é´Á¨Ã«D¶|¤ë
                _cIsLeapMonth = false;
            }
            else
            {
                //¨Ï¥Î¥Î¤á¿é¤Jªº¬O§_¶|¤ë¤ë¥÷
                _cIsLeapMonth = leapMonthFlag;
            }

            //·í¦~¨S¦³¶|¤ë||­pºâ¤ë¥÷¤p©ó¶|¤ë
            if ((_cIsLeapYear == false) || (cm < leap))
            {
                for (i = 1; i < cm; i++)
                {
                    Temp = GetChineseMonthDays(cy, i);//­pºâ«D¶|¤ë¤Ñ¼Æ
                    offset = offset + Temp;
                }

                //ÀË¬d¤é´Á¬O§_¤j©ó³Ì¤j¤Ñ
                if (cd > GetChineseMonthDays(cy, cm))
                {
                    throw new Exception("¤£¦Xªkªº¹A¾ä¤é´Á");
                }
                //¥[¤W·í¤ëªº¤Ñ¼Æ
                offset = offset + cd;
            }

            //¬O¶|¦~¡A¥B­pºâ¤ë¥÷¤j©ó©Îµ¥©ó¶|¤ë
            else
            {
                for (i = 1; i < cm; i++)
                {
                    //­pºâ«D¶|¤ë¤Ñ¼Æ
                    Temp = GetChineseMonthDays(cy, i);
                    offset = offset + Temp;
                }

                //­pºâ¤ë¤j©ó¶|¤ë
                if (cm > leap)
                {
                    Temp = GetChineseLeapMonthDays(cy);   //­pºâ¶|¤ë¤Ñ¼Æ
                    offset = offset + Temp;               //¥[¤W¶|¤ë¤Ñ¼Æ

                    if (cd > GetChineseMonthDays(cy, cm))
                    {
                        throw new Exception("¤£¦Xªkªº¹A¾ä¤é´Á");
                    }
                    offset = offset + cd;
                }

                //­pºâ¤ëµ¥©ó¶|¤ë
                else
                {
                    //¦pªG»Ý­n­pºâªº¬O¶|¤ë¡A«hÀ³­º¥ý¥[¤W»P¶|¤ë¹ïÀ³ªº´¶³q¤ëªº¤Ñ¼Æ
                    if (this._cIsLeapMonth == true)         //­pºâ¤ë¬°¶|¤ë
                    {
                        Temp = GetChineseMonthDays(cy, cm); //­pºâ«D¶|¤ë¤Ñ¼Æ
                        offset = offset + Temp;
                    }

                    if (cd > GetChineseLeapMonthDays(cy))
                    {
                        throw new Exception("¤£¦Xªkªº¹A¾ä¤é´Á");
                    }
                    offset = offset + cd;
                }
            }
            _date = MinDay.AddDays(offset);
        }
        #endregion
        #endregion

        #region ¨p¦³¨ç¼Æ
        #region GetChineseMonthDays
        /// <summary>
        /// //¶Ç¦^¹A¾äy¦~m¤ëªºÁ`¤Ñ¼Æ
        /// </summary>
        private int GetChineseMonthDays(int year, int month)
        {
            if (BitTest32((LunarDateArray[year - MinYear] & 0x0000FFFF), (16 - month)))
            {
                return 30;
            }
            else
            {
                return 29;
            }
        }
        #endregion

        #region GetChineseLeapMonth
        /// <summary>
        /// ¶Ç¦^¹A¾ä y¦~¶|­þ­Ó¤ë 1-12 , ¨S¶|¶Ç¦^ 0
        /// </summary>
        private int GetChineseLeapMonth(int year)
        {
            return LunarDateArray[year - MinYear] & 0xF;
        }
        #endregion

        #region GetChineseLeapMonthDays
        /// <summary>
        /// ¶Ç¦^¹A¾äy¦~¶|¤ëªº¤Ñ¼Æ
        /// </summary>
        private int GetChineseLeapMonthDays(int year)
        {
            if (GetChineseLeapMonth(year) != 0)
            {
                if ((LunarDateArray[year - MinYear] & 0x10000) != 0)
                {
                    return 30;
                }
                else
                {
                    return 29;
                }
            }
            else
            {
                return 0;
            }
        }
        #endregion

        #region GetChineseYearDays
        /// <summary>
        /// ¨ú¹A¾ä¦~¤@¦~ªº¤Ñ¼Æ
        /// </summary>
        private int GetChineseYearDays(int year)
        {
            int i, f, sumDay, info;

            sumDay = 348; //29¤Ñ*12­Ó¤ë
            i = 0x8000;
            info = LunarDateArray[year - MinYear] & 0x0FFFF;

            //­pºâ12­Ó¤ë¤¤¦³¦h¤Ö¤Ñ¬°30¤Ñ
            for (int m = 0; m < 12; m++)
            {
                f = info & i;
                if (f != 0)
                {
                    sumDay++;
                }
                i = i >> 1;
            }
            return sumDay + GetChineseLeapMonthDays(year);
        }
        #endregion

        #region GetChineseHour
        /// <summary>
        /// Àò±o·í«e®É¶¡ªº®É¨°
        /// </summary> 
        private string GetChineseHour(DateTime dt)
        {
            int _hour, _minute, offset, i;
            int indexGan;
            string ganHour, zhiHour;
            string tmpGan;

            //­pºâ®É¨°ªº¦a¤ä
            _hour = dt.Hour;    //Àò±o·í«e®É¶¡¤p®É
            _minute = dt.Minute;  //Àò±o·í«e®É¶¡¤ÀÄÁ

            if (_minute != 0) _hour += 1;
            offset = _hour / 2;
            if (offset >= 12) offset = 0;
            //zhiHour = zhiStr[offset].ToString();

            //­pºâ¤Ñ¤z
            TimeSpan ts = this._date - GanZhiStartDay;
            i = ts.Days % 60;

            //ganStr[i % 10] ¬°¤éªº¤Ñ¤z,(n*2-1) %10±o¥X¦a¤ä¹ïÀ³,n±q1¶}©l
            indexGan = ((i % 10 + 1) * 2 - 1) % 10 - 1;

            tmpGan = ganStr.Substring(indexGan) + ganStr.Substring(0, indexGan + 2);//´ê»ô12¦ì
            //ganHour = ganStr[((i % 10 + 1) * 2 - 1) % 10 - 1].ToString();

            return tmpGan[offset].ToString() + zhiStr[offset].ToString();
        }
        #endregion

        #region CheckDateLimit
        /// <summary>
        /// ÀË¬d¤½¾ú¤é´Á¬O§_²Å¦X­n¨D
        /// </summary>
        private void CheckDateLimit(DateTime dt)
        {
            if ((dt < MinDay) || (dt > MaxDay))
            {
                throw new Exception("¶W¥X¥iÂà´«ªº¤é´Á");
            }
        }
        #endregion

        #region CheckChineseDateLimit
        /// <summary>
        /// ÀË¬d¹A¾ä¤é´Á¬O§_¦X²z
        /// </summary>
        private void CheckChineseDateLimit(int year, int month, int day, bool leapMonth)
        {
            if ((year < MinYear) || (year > MaxYear))
            {
                throw new Exception("«Dªk¹A¾ä¤é´Á");
            }
            if ((month < 1) || (month > 12))
            {
                throw new Exception("«Dªk¹A¾ä¤é´Á");
            }
            if ((day < 1) || (day > 30)) //¤¤°êªº¤ë³Ì¦h30¤Ñ
            {
                throw new Exception("«Dªk¹A¾ä¤é´Á");
            }
            int leap = GetChineseLeapMonth(year);// ­pºâ¸Ó¦~À³¸Ó¶|­þ­Ó¤ë
            if ((leapMonth == true) && (month != leap))
            {
                throw new Exception("«Dªk¹A¾ä¤é´Á");
            }
        }
        #endregion

        #region ConvertNumToChineseNum
        /// <summary>
        /// ±N0-9Âà¦¨º~¦r§Î¦¡
        /// </summary>
        private string ConvertNumToChineseNum(char n)
        {
            if ((n < '0') || (n > '9')) return "";
            switch (n)
            {
                case '0':
                    return HZNum[0].ToString();
                case '1':
                    return HZNum[1].ToString();
                case '2':
                    return HZNum[2].ToString();
                case '3':
                    return HZNum[3].ToString();
                case '4':
                    return HZNum[4].ToString();
                case '5':
                    return HZNum[5].ToString();
                case '6':
                    return HZNum[6].ToString();
                case '7':
                    return HZNum[7].ToString();
                case '8':
                    return HZNum[8].ToString();
                case '9':
                    return HZNum[9].ToString();
                default:
                    return "";
            }
        }
        #endregion

        #region BitTest32
        /// <summary>
        /// ´ú¸Õ¬Y¦ì¬O§_¬°¯u
        /// </summary>
        private bool BitTest32(int num, int bitpostion)
        {
            if ((bitpostion > 31) || (bitpostion < 0))
                throw new Exception("Error Param: bitpostion[0-31]:" + bitpostion.ToString());

            int bit = 1 << bitpostion;

            if ((num & bit) == 0)
            {
                return false;
            }
            else
            {
                return true;
            }
        }
        #endregion

        #region ConvertDayOfWeek
        /// <summary>
        /// ±N¬P´Á´XÂà¦¨¼Æ¦rªí¥Ü
        /// </summary>
        private int ConvertDayOfWeek(DayOfWeek dayOfWeek)
        {
            switch (dayOfWeek)
            {
                case DayOfWeek.Sunday:
                    return 1;
                case DayOfWeek.Monday:
                    return 2;
                case DayOfWeek.Tuesday:
                    return 3;
                case DayOfWeek.Wednesday:
                    return 4;
                case DayOfWeek.Thursday:
                    return 5;
                case DayOfWeek.Friday:
                    return 6;
                case DayOfWeek.Saturday:
                    return 7;
                default:
                    return 0;
            }
        }
        #endregion

        #region CompareWeekDayHoliday
        /// <summary>
        /// ¤ñ¸û·í¤Ñ¬O¤£¬O«ü©wªº²Ä©P´X
        /// </summary>
        private bool CompareWeekDayHoliday(DateTime date, int month, int week, int day)
        {
            bool ret = false;

            if (date.Month == month) //¤ë¥÷¬Û¦P
            {
                if (ConvertDayOfWeek(date.DayOfWeek) == day) //¬P´Á´X¬Û¦P
                {
                    DateTime firstDay = new DateTime(date.Year, date.Month, 1);//¥Í¦¨·í¤ë²Ä¤@¤Ñ
                    int i = ConvertDayOfWeek(firstDay.DayOfWeek);
                    int firWeekDays = 7 - ConvertDayOfWeek(firstDay.DayOfWeek) + 1; //­pºâ²Ä¤@©P³Ñ¾l¤Ñ¼Æ

                    if (i > day)
                    {
                        if ((week - 1) * 7 + day + firWeekDays == date.Day)
                        {
                            ret = true;
                        }
                    }
                    else
                    {
                        if (day + firWeekDays + (week - 2) * 7 == date.Day)
                        {
                            ret = true;
                        }
                    }
                }
            }

            return ret;
        }
        #endregion
        #endregion

        #region  ÄÝ©Ê
        #region ¸`¤é
        #region newCalendarHoliday
        /// <summary>
        /// ­pºâ¤¤°ê¹A¾ä¸`¤é
        /// </summary>
        public string newCalendarHoliday
        {
            get
            {
                string tempStr = "";
                if (this._cIsLeapMonth == false) //¶|¤ë¤£­pºâ¸`¤é
                {
                    foreach (LunarHolidayStruct lh in lHolidayInfo)
                    {
                        if ((lh.Month == this._cMonth) && (lh.Day == this._cDay))
                        {

                            tempStr = lh.HolidayName;
                            break;

                        }
                    }

                    //¹ï°£¤i¶i¦æ¯S§O³B²z
                    if (this._cMonth == 12)
                    {
                        int i = GetChineseMonthDays(this._cYear, 12); //­pºâ·í¦~¹A¾ä12¤ëªºÁ`¤Ñ¼Æ
                        if (this._cDay == i) //¦pªG¬°³Ì«á¤@¤Ñ
                        {
                            tempStr = "°£¤i";
                        }
                    }
                }
                return tempStr;
            }
        }
        #endregion

        #region WeekDayHoliday
        /// <summary>
        /// «ö¬Y¤ë²Ä´X©P²Ä´X¤é­pºâªº¸`¤é
        /// </summary>
        public string WeekDayHoliday
        {
            get
            {
                string tempStr = "";
                foreach (WeekHolidayStruct wh in wHolidayInfo)
                {
                    if (CompareWeekDayHoliday(_date, wh.Month, wh.WeekAtMonth, wh.WeekDay))
                    {
                        tempStr = wh.HolidayName;
                        break;
                    }
                }
                return tempStr;
            }
        }
        #endregion

        #region DateHoliday
        /// <summary>
        /// «ö¤½¾ú¤é­pºâªº¸`¤é
        /// </summary>
        public string DateHoliday
        {
            get
            {
                string tempStr = "";

                foreach (SolarHolidayStruct sh in sHolidayInfo)
                {
                    if ((sh.Month == _date.Month) && (sh.Day == _date.Day))
                    {
                        tempStr = sh.HolidayName;
                        break;
                    }
                }
                return tempStr;
            }
        }
        #endregion
        #endregion

        #region ¤½¾ú¤é´Á
        #region Date
        /// <summary>
        /// ¨ú¹ïÀ³ªº¤½¾ú¤é´Á
        /// </summary>
        public DateTime Date
        {
            get { return _date; }
            set { _date = value; }
        }
        #endregion

        #region WeekDay
        /// <summary>
        /// ¨ú¬P´Á´X
        /// </summary>
        public DayOfWeek WeekDay
        {
            get { return _date.DayOfWeek; }
        }
        #endregion

        #region WeekDayStr
        /// <summary>
        /// ©P´Xªº¦r²Å
        /// </summary>
        public string WeekDayStr
        {
            get
            {
                switch (_date.DayOfWeek)
                {
                    case DayOfWeek.Sunday:
                        return "¬P´Á¤é";
                    case DayOfWeek.Monday:
                        return "¬P´Á¤@";
                    case DayOfWeek.Tuesday:
                        return "¬P´Á¤G";
                    case DayOfWeek.Wednesday:
                        return "¬P´Á¤T";
                    case DayOfWeek.Thursday:
                        return "¬P´Á¥|";
                    case DayOfWeek.Friday:
                        return "¬P´Á¤­";
                    default:
                        return "¬P´Á¤»";
                }
            }
        }
        #endregion

        #region DateString
        /// <summary>
        /// ¤½¾ú¤é´Á¤¤¤åªí¥Üªk ¦p¤@¤E¤E¤C¦~¤C¤ë¤@¤é
        /// </summary>
        public string DateString
        {
            get
            {
                return "¤½¤¸" + this._date.ToLongDateString();
            }
        }
        #endregion

        #region IsLeapYear
        /// <summary>
        /// ·í«e¬O§_¤½¾ú¶|¦~
        /// </summary>
        public bool IsLeapYear
        {
            get
            {
                return DateTime.IsLeapYear(this._date.Year);
            }
        }
        #endregion

        #region ChineseConstellation
        /// <summary>
        /// 28¬P±J­pºâ
        /// </summary>
        public string ChineseConstellation
        {
            get
            {
                int offset = 0;
                int modStarDay = 0;

                TimeSpan ts = this._date - ChineseConstellationReferDay;
                offset = ts.Days;
                modStarDay = offset % 28;
                return (modStarDay >= 0 ? _chineseConstellationName[modStarDay] : _chineseConstellationName[27 + modStarDay]);
            }
        }
        #endregion

        #region ChineseHour
        /// <summary>
        /// ®É¨°
        /// </summary>
        public string ChineseHour
        {
            get
            {
                return GetChineseHour(_datetime);
            }
        }
        #endregion

        #endregion

        #region ¹A¾ä¤é´Á
        #region IsChineseLeapMonth
        /// <summary>
        /// ¬O§_¶|¤ë
        /// </summary>
        public bool IsChineseLeapMonth
        {
            get { return this._cIsLeapMonth; }
        }
        #endregion

        #region IsChineseLeapYear
        /// <summary>
        /// ·í¦~¬O§_¦³¶|¤ë
        /// </summary>
        public bool IsChineseLeapYear
        {
            get
            {
                return this._cIsLeapYear;
            }
        }
        #endregion

        #region ChineseDay
        /// <summary>
        /// ¹A¾ä¤é
        /// </summary>
        public int ChineseDay
        {
            get { return this._cDay; }
        }
        #endregion

        #region ChineseDayString
        /// <summary>
        /// ¹A¾ä¤é¤¤¤åªí¥Ü
        /// </summary>
        public string ChineseDayString
        {
            get
            {
                switch (this._cDay)
                {
                    case 0:
                        return "";
                    case 10:
                        return "ªì¤Q";
                    case 20:
                        return "¤G¤Q";
                    case 30:
                        return "¤T¤Q";
                    default:
                        return nStr2[(int)(_cDay / 10)].ToString() + nStr1[_cDay % 10].ToString();

                }
            }
        }
        #endregion

        #region ChineseMonth
        /// <summary>
        /// ¹A¾äªº¤ë¥÷
        /// </summary>
        public int ChineseMonth
        {
            get { return this._cMonth; }
        }
        #endregion

        #region ChineseMonthString
        /// <summary>
        /// ¹A¾ä¤ë¥÷¦r²Å¦ê
        /// </summary>
        public string ChineseMonthString
        {
            get
            {
                return _monthString[this._cMonth];
            }
        }
        #endregion

        #region ChineseYear
        /// <summary>
        /// ¨ú¹A¾ä¦~¥÷
        /// </summary>
        public int ChineseYear
        {
            get { return this._cYear; }
        }
        #endregion

        #region ChineseYearString
        /// <summary>
        /// ¨ú¹A¾ä¦~¦r²Å¦ê¦p¡A¤@¤E¤E¤C¦~
        /// </summary>
        public string ChineseYearString
        {
            get
            {
                string tempStr = "";
                string num = this._cYear.ToString();
                for (int i = 0; i < 4; i++)
                {
                    tempStr += ConvertNumToChineseNum(num[i]);
                }
                return tempStr + "¦~";
            }
        }
        #endregion

        #region ChineseDateString
        /// <summary>
        /// ¨ú¹A¾ä¤é´Áªí¥Üªk¡G¹A¾ä¤@¤E¤E¤C¦~¥¿¤ëªì¤­
        /// </summary>
        public string ChineseDateString
        {
            get
            {
                if (this._cIsLeapMonth == true)
                {
                    return "¹A¾ä" + ChineseYearString + "¶|" + ChineseMonthString + ChineseDayString;
                }
                else
                {
                    return "¹A¾ä" + ChineseYearString + ChineseMonthString + ChineseDayString;
                }
            }
        }
        #endregion

        #region ChineseTwentyFourDay
        /// <summary>
        /// ©w®ðªk­pºâ¤G¤Q¥|¸`®ð,¤G¤Q¥|¸`®ð¬O«ö¦a²y¤½Âà¨Ó­pºâªº¡A¨Ã«D¬O³±¾ä­pºâªº
        /// </summary>
        /// <remarks>
        /// ¸`®ðªº©wªk¦³¨âºØ¡C¥j¥N¾äªk±Ä¥ÎªººÙ¬°"«í®ð"¡A§Y«ö®É¶¡§â¤@¦~µ¥¤À¬°24¥÷¡A
        /// ¨C¤@¸`®ð¥­§¡±o15¤Ñ¦³¾l¡A©Ò¥H¤SºÙ"¥­®ð"¡C²{¥N¹A¾ä±Ä¥ÎªººÙ¬°"©w®ð"¡A§Y
        /// «ö¦a²y¦b­y¹D¤Wªº¦ì¸m¬°¼Ð·Ç¡A¤@©P360¢X¡A¨â¸`®ð¤§¶¡¬Û¹j15¢X¡C¥Ñ©ó¥V¦Ü®É¦a
        /// ²y¦ì©óªñ¤éÂIªþªñ¡A¹B°Ê³t«×¸û§Ö¡A¦]¦Ó¤Ó¶§¦b¶À¹D¤W²¾°Ê15¢Xªº®É¶¡¤£¨ì15¤Ñ¡C
        /// ®L¦Ü«e«áªº±¡ªp¥¿¦n¬Û¤Ï¡A¤Ó¶§¦b¶À¹D¤W²¾°Ê¸ûºC¡A¤@­Ó¸`®ð¹F16¤Ñ¤§¦h¡C±Ä¥Î
        /// ©w®ð®É¥i¥H«OÃÒ¬K¡B¬î¨â¤À¥²µM¦b±Þ©]¥­¤Àªº¨º¨â¤Ñ¡C
        /// </remarks>
        public string ChineseTwentyFourDay
        {
            get
            {
                DateTime baseDateAndTime = new DateTime(1900, 1, 6, 2, 5, 0); //#1/6/1900 2:05:00 AM#
                DateTime newDate;
                double num;
                int y;
                string tempStr = "";

                y = this._date.Year;

                for (int i = 1; i <= 24; i++)
                {
                    num = 525948.76 * (y - 1900) + sTermInfo[i - 1];

                    newDate = baseDateAndTime.AddMinutes(num);//«ö¤ÀÄÁ­pºâ
                    if (newDate.DayOfYear == _date.DayOfYear)
                    {
                        tempStr = SolarTerm[i - 1];
                        break;
                    }
                }
                return tempStr;
            }
        }

        //·í«e¤é´Á«e¤@­Ó³Ìªñ¸`®ð
        public string ChineseTwentyFourPrevDay
        {
            get
            {
                DateTime baseDateAndTime = new DateTime(1900, 1, 6, 2, 5, 0); //#1/6/1900 2:05:00 AM#
                DateTime newDate;
                double num;
                int y;
                string tempStr = "";

                y = this._date.Year;

                for (int i = 24; i >= 1; i--)
                {
                    num = 525948.76 * (y - 1900) + sTermInfo[i - 1];

                    newDate = baseDateAndTime.AddMinutes(num);//«ö¤ÀÄÁ­pºâ

                    if (newDate.DayOfYear < _date.DayOfYear)
                    {
                        tempStr = string.Format("{0}[{1}]", SolarTerm[i - 1], newDate.ToString("yyyy-MM-dd"));
                        break;
                    }
                }

                return tempStr;
            }

        }

        //·í«e¤é´Á«á¤@­Ó³Ìªñ¸`®ð
        public string ChineseTwentyFourNextDay
        {
            get
            {
                DateTime baseDateAndTime = new DateTime(1900, 1, 6, 2, 5, 0); //#1/6/1900 2:05:00 AM#
                DateTime newDate;
                double num;
                int y;
                string tempStr = "";

                y = this._date.Year;

                for (int i = 1; i <= 24; i++)
                {
                    num = 525948.76 * (y - 1900) + sTermInfo[i - 1];

                    newDate = baseDateAndTime.AddMinutes(num);//«ö¤ÀÄÁ­pºâ

                    if (newDate.DayOfYear > _date.DayOfYear)
                    {
                        tempStr = string.Format("{0}[{1}]", SolarTerm[i - 1], newDate.ToString("yyyy-MM-dd"));
                        break;
                    }
                }
                return tempStr;
            }

        }
        #endregion
        #endregion

        #region ¬P®y
        /// <summary>
        /// ­pºâ«ü©w¤é´Áªº¬P®y§Ç¸¹ 
        /// </summary>
        public string Constellation
        {
            get
            {
                int index = 0;
                int y, m, d;
                y = _date.Year;
                m = _date.Month;
                d = _date.Day;
                y = m * 100 + d;

                if (((y >= 321) && (y <= 419))) { index = 0; }
                else if ((y >= 420) && (y <= 520)) { index = 1; }
                else if ((y >= 521) && (y <= 620)) { index = 2; }
                else if ((y >= 621) && (y <= 722)) { index = 3; }
                else if ((y >= 723) && (y <= 822)) { index = 4; }
                else if ((y >= 823) && (y <= 922)) { index = 5; }
                else if ((y >= 923) && (y <= 1022)) { index = 6; }
                else if ((y >= 1023) && (y <= 1121)) { index = 7; }
                else if ((y >= 1122) && (y <= 1221)) { index = 8; }
                else if ((y >= 1222) || (y <= 119)) { index = 9; }
                else if ((y >= 120) && (y <= 218)) { index = 10; }
                else if ((y >= 219) && (y <= 320)) { index = 11; }
                else { index = 0; }

                return _constellationName[index];
            }
        }
        #endregion

        #region ÄÝ¬Û
        #region Animal
        /// <summary>
        /// ­pºâÄÝ¬Ûªº¯Á¤Þ¡Aª`·NÁöµMÄÝ¬Û¬O¥H¹A¾ä¦~¨Ó°Ï§Oªº¡A¦ý¬O¥Ø«e¦b¹ê»Ú¨Ï¥Î¤¤¬O«ö¤½¾ú¨Ó­pºâªº
        /// ¹«¦~¬°1,¨ä¥¦Ãþ±À
        /// </summary>
        public int Animal
        {
            get
            {
                int offset = _date.Year - AnimalStartYear;
                return (offset % 12) + 1;
            }
        }
        #endregion

        #region AnimalString
        /// <summary>
        /// ¨úÄÝ¬Û¦r²Å¦ê
        /// </summary>
        public string AnimalString
        {
            get
            {
                int offset = _date.Year - AnimalStartYear; //¶§¾ä­pºâ
                //int offset = this._cYear - AnimalStartYear;¡@¹A¾ä­pºâ
                return animalStr[offset % 12].ToString();
            }
        }
        #endregion
        #endregion

        #region ¤Ñ¤z¦a¤ä
        #region GanZhiYearString
        /// <summary>
        /// ¨ú¹A¾ä¦~ªº¤z¤äªí¥Üªk¦p ¤A¤¡¦~
        /// </summary>
        public string GanZhiYearString
        {
            get
            {
                string tempStr;
                int i = (this._cYear - GanZhiStartYear) % 60; //­pºâ¤z¤ä
                tempStr = ganStr[i % 10].ToString() + zhiStr[i % 12].ToString() + "¦~";
                return tempStr;
            }
        }
        #endregion

        #region GanZhiMonthString
        /// <summary>
        /// ¨ú¤z¤äªº¤ëªí¥Ü¦r²Å¦ê¡Aª`·N¹A¾äªº¶|¤ë¤£°O¤z¤ä
        /// </summary>
        public string GanZhiMonthString
        {
            get
            {
                //¨C­Ó¤ëªº¦a¤äÁ`¬O©T©wªº,¦Ó¥BÁ`¬O±q±G¤ë¶}©l
                int zhiIndex;
                string zhi;
                if (this._cMonth > 10)
                {
                    zhiIndex = this._cMonth - 10;
                }
                else
                {
                    zhiIndex = this._cMonth + 2;
                }
                zhi = zhiStr[zhiIndex - 1].ToString();

                //®Ú¾Ú·í¦~ªº¤z¤ä¦~ªº¤z¨Ó­pºâ¤ë¤zªº²Ä¤@­Ó
                int ganIndex = 1;
                string gan;
                int i = (this._cYear - GanZhiStartYear) % 60; //­pºâ¤z¤ä
                switch (i % 10)
                {
                    #region ...
                    case 0: //¥Ò
                        ganIndex = 3;
                        break;
                    case 1: //¤A
                        ganIndex = 5;
                        break;
                    case 2: //¤þ
                        ganIndex = 7;
                        break;
                    case 3: //¤B
                        ganIndex = 9;
                        break;
                    case 4: //¥³
                        ganIndex = 1;
                        break;
                    case 5: //¤v
                        ganIndex = 3;
                        break;
                    case 6: //©°
                        ganIndex = 5;
                        break;
                    case 7: //¨¯
                        ganIndex = 7;
                        break;
                    case 8: //¤Ð
                        ganIndex = 9;
                        break;
                    case 9: //¬Ñ
                        ganIndex = 1;
                        break;
                    #endregion
                }
                gan = ganStr[(ganIndex + this._cMonth - 2) % 10].ToString();

                return gan + zhi + "¤ë";
            }
        }
        #endregion

        #region GanZhiDayString
        /// <summary>
        /// ¨ú¤z¤ä¤éªí¥Üªk
        /// </summary>
        public string GanZhiDayString
        {
            get
            {
                int i, offset;
                TimeSpan ts = this._date - GanZhiStartDay;
                offset = ts.Days;
                i = offset % 60;
                return ganStr[i % 10].ToString() + zhiStr[i % 12].ToString() + "¤é";
            }
        }
        #endregion

        #region GanZhiDateString
        /// <summary>
        /// ¨ú·í«e¤é´Áªº¤z¤äªí¥Üªk¦p ¥Ò¤l¦~¤A¤¡¤ë¤þ©°¤é
        /// </summary>
        public string GanZhiDateString
        {
            get
            {
                return GanZhiYearString + GanZhiMonthString + GanZhiDayString;
            }
        }
        #endregion
        #endregion
        #endregion
    }
}


