| 
					 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55  | 
						//양력은 음력으로변환 테스트 private void button1_Click(object sender, EventArgs e) { 	label1.Text =음력변환(2007, 1, 1); 	label2.Text = 음력변환(DateTime.Now); } //음력을 양력으로 변환 테스트 private void button2_Click(object sender, EventArgs e) { 	label2.Text = 양력변환(2006,11,13,false).ToShortDateString(); } private string 음력변환(DateTime dt) { 	int n윤월; 	int n음력년, n음력월, n음력일; 	bool b윤달 = false; 	System.Globalization.KoreanLunisolarCalendar 음력 =  	new System.Globalization.KoreanLunisolarCalendar(); 	n음력년 = 음력.GetYear(dt); 	n음력월 = 음력.GetMonth(dt); 	n음력일 = 음력.GetDayOfMonth(dt); 	if (음력.GetMonthsInYear(n음력년) > 12)             //1년이 12이상이면 윤달이 있음.. 	{ 		b윤달 = 음력.IsLeapMonth(n음력년, n음력월);     //윤월인지 		n윤월 = 음력.GetLeapMonth(n음력년);             //년도의 윤달이 몇월인지? 		if (n음력월 >= n윤월)                           //달이 윤월보다 같거나 크면 -1을 함 즉 윤8은->9 이기때문 		n음력월--; 	} 	return n음력년.ToString() + "-" + (b윤달 ? "*" : "") + n음력월.ToString() + "-" + n음력일.ToString(); } private string 음력변환(int n양력년, int n양력월, int n양력일) { 	DateTime dTemp = new DateTime(n양력년, n양력월, n양력일); //양력 	return 음력변환(dTemp); } private DateTime 양력변환(int n음력년, int n음력월, int n음력일, bool b달) { 	int n윤월;  	System.Globalization.KoreanLunisolarCalendar 음력 =  	new System.Globalization.KoreanLunisolarCalendar(); 	if (음력.GetMonthsInYear(n음력년) > 12) 	{ 		n윤월 = 음력.GetLeapMonth(n음력년); 		if (b달) 			n음력월++; 		if (n음력월 > n윤월) 			n음력월++; 	} 	return 음력.ToDateTime(n음력년, n음력월, n음력일, 0, 0, 0, 0); }  | 
					
