Snowfun

导航

 
using System;
using System.Collections.Generic;
using System.Text;
using System.Globalization;

namespace EasyDotNet.Calendar
{
    
public class ABC
    {
        
private int _year = 1990, _month = 1, _day = 1;
        
private string[] dayName = new string[] {
            
"初一","初二","初三","初四","初五","初六","初七","初八","初九","初十",
            
"十一","十二","十三","十四","十五","十六","十七","十八","十九","二十",
            
"廿一","廿二","廿三","廿四","廿五","廿六","廿七","廿八","廿九","三十"};


        
private ChineseLunisolarCalendar clc = new ChineseLunisolarCalendar();   
        
public ABC(DateTime dt)
        {
            _year 
= clc.GetYear(dt);
            _month 
= clc.GetMonth(dt);
            _day 
= clc.GetDayOfMonth(dt);
        }

        
private string _dayname;
        
public string GetDayName { get { _dayname = dayName[_day - 1]; return _dayname; } }
        
    }
}

 

 

 ABC aa = new ABC(DateTime.Now);
 txt1.Text 
="今日是農歷" +aa.GetDayName;

 

posted on 2011-06-24 11:16  Snowfun  阅读(314)  评论(0编辑  收藏  举报