// The following is a lunar calendar algorithm / / date data definition method as follows // The first 12 bytes represent from 1 to December for the day, 1 for the day, 0 is the month 29 days , // The 13th is the case of the month, and 1 is 30 days in the month, 0 is 29 days in Xiaoyue, and the 14th, 15th is the month / / part of the month, and the 10 binding is used. The last 4 is the date of the Lunar New Year in the year - the date of the lunar calendar on January 1, such as 0131 on behalf of January 31. // Date function usage, such as the question of the question of the Queen Calenda, i Queu Yue is the public calendar, i Qi Causa is // Qi Causa, return value is: belonging, day dry land, the lunar calendar.
using System; namespace {public class components Lunar Lunar {private string [] m_str lunar calendar; private string [] m_str attribution table; private string m_str zodiac table; private string m_str lunar months table; private string m_str lunar date table; private int m_i maximum calendar year; private int m_i minimum calendar year; public lunar () {m_str lunar calendar = new string [] { "0100101101101080131", "0100101011100000219", "1010010101110000208", "0101001001101050129", "1101001001100000216", "1101100101010000204 "" 0110101010101040125 "" 0101011010100000213 "" 1001101011010000202 "" 0100101011101020122 "" 0100101011100000210 "" 1010010011011060130 "" 1010010011010000218 "" 1101001001010000206 "" 1101010101001050126 "" 1011010101010000214 "" 0101011010100000204 "" 1001011011010020123 " "1001010110110000211" "0100100110111070201" "0100100110110000220" "1010010010110000208" "1011001001011050128" "0110101001010000216" "0110110101000000205" "1010110110101040124" "001 010 110 110 0000213, "" 1001010101110000202 "" 0100100101111020123 "" 0100100101110000210 "" 0110010010110060130 "" 1101010010100000217 "" 1110101001010000206 "" 0110110101001050126 "" 0101101011010000214 "" 0010101101100000204 "" 1001001101110030124 "" 1001001011100000211 "" 1100100101101070131 " "110010010101000000219", "1101010010100000208", "
1101101001010060127 "" 1011010101010000215 "" 0101011010100000205 "" 1010101011011040125 "" 0010010111010000213 "" 1001001011010000202 "" 1100100101011020122 "" 1010100101010000210 "" 1011010010101070129 "" 0110110010100000217 "" 1011010101010000206 "" 0101010110101050127 "" 0100110110100000214 " "1010010110110000203" "0101001010111030124" "0101001010110000212" "1010100101010080131" "1110100101010000218" "0110101010100000208" "1010110101010060128" "1010101101010000215" "0100101101100000205" "1010010101110040125" "1010010101110000213" "0101001001100000202" " 1110100100110030121 "" 1101100101010000209 "" 0101101010101070130 "" 0101011010100000217 "" 1001011011010000206 "" 0100101011101050127 "" 0100101011010000215 "" 1010010011010000203 "" 1101001001101040123 "" 1101001001010000211 "" 1101010100101080131 "" 1011010101000000218 "" 1 011011010100000207 "" 1001011011010060128 "" 1001010110110000216 "" 0100100110110000205 "" 1010010010111040125 "" 1010010010110000213 "" 1011001001011100202 "" 0110101001010000220 "" 0110110101000000209 "" 1010110110101060129 "" 1010101101100000217 "" 1001001101110000206 "" 0100100101111050127 " "
0100100101110000215 "" 0110010010110000204 "" 0110101001010030123 "" 1110101001010000210 "" 0110101100101080131 "" 0101101011000000219 "" 1010101101100000207 "" 1001001101101050128 "" 1001001011100000216 "" 1100100101100000205 "" 1101010010101040124 "" 1101010010100000212 "" 1101101001010000201 " , "0101101010101020122", "0101011010100000209", "1010101011011070129", "0010010111010000218", "1001001011010000207", "1100100101011050126", "1010100101010000214", "1011010010100000214"}; m_str Zodiac table = "rat ox tiger rabbit snakes horse sheep pig monkey Jigou "; M_STR lunar month =" Zheng two or three or five six seven eight ninety cold tomorrow; M_STR Lunar day = "The first third day of the first three first six first seventh eight eighth year ten eleven 1234524th 2 二 二 三 四 四 五 三 ";;;;;;;;;;;;;;;;;;;;;;;;;; Years = 1900; String Str's dry = "methyl base-base"; String Str's branch = "Zi ugly 寅 辰 巳 巳 未 未 未 未;;; 表 表 表 表 表" I <60; i ) {m_STR Tested Table [I] = Str Tian dry. Substring (I% 10, 1) Str. Substring (I% 12, 1);}} public string Date (INT I Quality,INT i genuine month, INT I Qi Daxia) {IF ((i Qian calendar
Return "Invalid Quality Year";} // Calculate the Lunar Year INT I Lunar Year; INT I Lunar Month; INT I Lunar Day; I Lunar Year = I Quality Calendar; // Lunar New Year I Lunition = Convert.Toint32 (( M_STR Lunar Calendar [I Lunar Year - M_i Minimum Genuine] .substring (15, 2))); // Lunar New Year I Lunar Day = Convert.Toint32 ((M_Str Lunar Calendar [i Lunar Year - M_i Minimum Quality) Years] .substring (17, 2)))) ;; if ((i Quan calendar