想把日 1日 转换成 一日  刚才有人给我月的30天 自己能了个 觉得不行 给个思路吧

解决方案 »

  1.   

    真是有意思,刚才给你的时候,你的日是用数字显示的,就没给你转,现在又想转了^_^private void Page_Load(object sender, System.EventArgs e)
    {
    if(!Page.IsPostBack)
    {
    Response.Write(FormatMonth(dt.Month,DateTime.IsLeapYear(dt.Year))+FormatLunarDay(dt.Day)+"日");
    }
    }public string FormatMonth(int iMonth, bool bLunar) 

    string szText = "正二三四五六七八九十"; 
    string strMonth; 
    if ((!bLunar) && (iMonth == 1)) 
    { return "一月";} 
    if (iMonth <= 10) 

    strMonth = ""; 
    strMonth = strMonth + szText.Substring(iMonth - 1, 1); 
    strMonth = strMonth + "月"; 
    return strMonth; 

    if (iMonth == 11) 
    { strMonth = "十一";} 
    else 
    { strMonth = "十二";} 
    return strMonth + "月"; 
    }
    public string FormatLunarDay(int iDay) 

    string szText1 = "初十廿三"; 
    string szText2 = "一二三四五六七八九十"; 
    string strDay; 
    if ((iDay != 20) && (iDay != 30)) 

    strDay = szText1.Substring((iDay - 1) / 10, 1); 
    strDay = strDay + szText2.Substring((iDay - 1) % 10, 1); 

    else 

    //strDay = szText1.Substring((iDay / 10) * 2 + 1, 2); 
    strDay = szText1.Substring((iDay / 10) , 1); 
    strDay = strDay + "十"; 

    return strDay; 
    }