想把日 1日 转换成 一日 刚才有人给我月的30天 自己能了个 觉得不行 给个思路吧
解决方案 »
- 使用Sqlhelper,要引用哪个命名空间?
- gridview样式问题
- VS2008占用内存
- gridview 更新时的问题
- 关于CSDN页面保存实现的问题(欢迎高手都来探讨)
- 在哪能下到VS.NET2005所用控件的电子图书啊?
- 等解答!关于图片格式转换的问题,自己写的程序。。。。。。
- 入门问题:“未将对象引用设置到对象实例”
- error Message:Object reference not set to an instance of an object.
- 注册成功后能自动生成一个文件夹,求助!
- 在线考试系统
- http://lishi.godele.com/48281.5.378268/ 这样的网址是怎么做出来的
{
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;
}