C# 农历

来源:网络整理 责任编辑:栏目编辑 发表时间:2013-07-01 23:17 点击:
     using System;
  
  namespace CNCalendar
  {
  public class CNDate
  {
  private const ushort START_YEAR = 1901;
  private const ushort END_YEAR = 2050;
  private string[] ConstellationName =
  {
  "白羊座", "金牛座", "双子座",
  "巨蟹座", "狮子座", "处女座",
  "天秤座", "天蝎座", "射手座",
  "摩羯座", "水瓶座", "双鱼座"};
  private string[] LunarHolDayName =
  {
  "小寒", "大寒", "立春", "雨水",
  "惊蛰", "春分", "清明", "谷雨",
  "立夏", "小满", "芒种", "夏至",
  "小暑", "大暑", "立秋", "处暑",
  "白露", "秋分", "寒露", "霜降",
  "立冬", "小雪", "大雪", "冬至"};
  
  //数组gLunarDay存入阴历1901年到2100年每年中的月天数信息,
  //阴历每月只能是29或30天,一年用12(或13)个二进制位表示,对应位为1表30天,否则为29天
  private int[] gLunarMonthDay = {
  //测试数据只有1901.1.1 --2050.12.31
  0x4ae0, 0xa570, 0x5268, 0xd260, 0xd950, 0x6aa8, 0x56a0, 0x9ad0, 0x4ae8, 0x4ae0, //1910
  0xa4d8, 0xa4d0, 0xd250, 0xd548, 0xb550, 0x56a0, 0x96d0, 0x95b0, 0x49b8, 0x49b0, //1920
  0xa4b0, 0xb258, 0x6a50, 0x6d40, 0xada8, 0x2b60, 0x9570, 0x4978, 0x4970, 0x64b0, //1930
  0xd4a0, 0xea50, 0x6d48, 0x5ad0, 0x2b60, 0x9370, 0x92e0, 0xc968, 0xc950, 0xd4a0, //1940
  0xda50, 0xb550, 0x56a0, 0xaad8, 0x25d0, 0x92d0, 0xc958, 0xa950, 0xb4a8, 0x6ca0, //1950
  0xb550, 0x55a8, 0x4da0, 0xa5b0, 0x52b8, 0x52b0, 0xa950, 0xe950, 0x6aa0, 0xad50, //1960
  0xab50, 0x4b60, 0xa570, 0xa570, 0x5260, 0xe930, 0xd950, 0x5aa8, 0x56a0, 0x96d0, //1970
  0x4ae8, 0x4ad0, 0xa4d0, 0xd268, 0xd250, 0xd528, 0xb540, 0xb6a0, 0x96d0, 0x95b0, //1980
  0x49b0, 0xa4b8, 0xa4b0, 0xb258, 0x6a50, 0x6d40, 0xada0, 0xab60, 0x9370, 0x4978, //1990
  0x4970, 0x64b0, 0x6a50, 0xea50, 0x6b28, 0x5ac0, 0xab60, 0x9368, 0x92e0, 0xc960, //2000
  0xd4a8, 0xd4a0, 0xda50, 0x5aa8, 0x56a0, 0xaad8, 0x25d0, 0x92d0, 0xc958, 0xa950, //2010
  0xb4a0, 0xb550, 0xb550, 0x55a8, 0x4ba0, 0xa5b0, 0x52b8, 0x52b0, 0xa930, 0x74a8, //2020
  0x6aa0, 0xad50, 0x4da8, 0x4b60, 0x9570, 0xa4e0, 0xd260, 0xe930, 0xd530, 0x5aa0, //2030
  0x6b50, 0x96d0, 0x4ae8, 0x4ad0, 0xa4d0, 0xd258, 0xd250, 0xd520, 0xdaa0, 0xb5a0, //2040
  0x56d0, 0x4ad8, 0x49b0, 0xa4b8, 0xa4b0, 0xaa50, 0xb528, 0x6d20, 0xada0, 0x55b0}; //2050
  
  //数组gLanarMonth存放阴历1901年到2050年闰月的月份,如没有则为0,每字节存两年
  byte[] gLunarMonth={
  0x00, 0x50, 0x04, 0x00, 0x20, //1910
  0x60, 0x05, 0x00, 0x20, 0x70, //1920
  0x05, 0x00, 0x40, 0x02, 0x06, //1930
  0x00, 0x50, 0x03, 0x07, 0x00, //1940
  0x60, 0x04, 0x00, 0x20, 0x70, //1950
  0x05, 0x00, 0x30, 0x80, 0x06, //1960
  0x00, 0x40, 0x03, 0x07, 0x00, //1970
  0x50, 0x04, 0x08, 0x00, 0x60, //1980
  0x04, 0x0a, 0x00, 0x60, 0x05, //1990
  0x00, 0x30, 0x80, 0x05, 0x00, //2000
  0x40, 0x02, 0x07, 0x00, 0x50, //2010
  0x04, 0x09, 0x00, 0x60, 0x04, //2020
  0x00, 0x20, 0x60, 0x05, 0x00, //2030
  0x30, 0xb0, 0x06, 0x00, 0x50, //2040
  0x02, 0x07, 0x00, 0x50, 0x03}; //2050
  
  //数组gLanarHoliDay存放每年的二十四节气对应的阳历日期
  //每年的二十四节气对应的阳历日期几乎固定,平均分布于十二个月中
  // 1月 2月 3月 4月 5月 6月
  //小寒 大寒 立春 雨
    发表评论
    请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
    用户名: 验证码:点击我更换图片
    最新评论 更多>>

    推荐热点

    • 用C#制作屏幕捕获程序
    • .NET程序员项目开发必知必会—Dev环境中的集成测试用例执行时上
    • 遍历ArrayList易犯错误
    • C#对XML操作:一个处理XML文件的类(1)
    • .NET简谈反射(动态调用)
    • 使用C#编写LED样式时钟控件
    • DataList嵌套问题 如何删除内层子DataList的记录
    • 怎样用C#实现完整文档打印功能
    • .NET简谈自定义事务资源管理器
    网站首页 - 友情链接 - 网站地图 - TAG标签 - RSS订阅 - 内容搜索
    Copyright © 2008-2015 计算机技术学习交流网. 版权所有

    豫ICP备11007008号-1