友情链接1:21点 足球投注 投注网 明升体育 hg0088 葡京赌场 网上赌球 诈金花 澳门金沙网址 澳门银河网址 澳门银河 澳门银河官网 银河官网 威尼斯人 澳门威尼斯人 澳门威尼斯人官网 威尼斯人官网 金沙 澳门金沙 澳门金沙官网 金沙官网 现金网 赌球网 全讯网 明升国际 足球开户 ******官网 ******网址 现金赌博 澳门现金网 ******官方网站

.NET涓洓绉嶅叧浜庢樉绀烘槦鏈熷嚑 « Carey's Blog - 寤栧媷鐨勫崥瀹

.NET涓洓绉嶅叧浜庢樉绀烘槦鏈熷嚑

鏃堕棿锛2013骞05鏈15鏃浣滆咃細Carey闃呰(5,729)璇勮(璇勮鍏抽棴)

绗竴绉嶆柟娉:

DateTime.Now.GetDateTimeFormats('D')[2].ToString().Substring(0,3)

绗簩绉嶆柟娉:

public string Week()   

 {   

            string[] weekdays ={ "鏄熸湡鏃" ,"鏄熸湡涓" ,"鏄熸湡浜" ,"鏄熸湡涓" ,"鏄熸湡鍥" ,"鏄熸湡浜" ,"鏄熸湡鍏" };   

            string week=weekdays[Convert.ToInt32(DateTime.Now.DayOfWeek)];   

            return week;   

        }    

//Response.Write(Week()); 

绗笁绉嶆柟娉:

public string Week(string weekName)   

        {   

            string week;   

            switch(weekName)   

            {   

                case "Sunday":   

                    week = "鏄熸湡鏃";   

                    break;   

                case "Monday":   

                    week = "鏄熸湡涓";   

                    break;   

                case "Tuesday":   

                    week = "鏄熸湡浜";   

                    break;   

                case "Wednesday":   

                    week = "鏄熸湡涓";   

                    break;   

                case "Thursday":   

                    week = "鏄熸湡鍥";   

                    break;   

                case "Friday":   

                    week = "鏄熸湡浜";   

                    break;   

                case "Saturday":   

                    week = "鏄熸湡浜";   

                    break;   

                    return week;   

            }   

        }   

//Response.Write(Week(DateTime.Now.DayOfWeek));  

绗洓绉嶆柟娉:

string CaculateWeekDay(int y,int m, int d)   

{   

 if(m==1) {m=13;y--;}   

 if(m==2) {m=14;y--;}   

 int week=(d+2*m+3*(m+1)/5+y+y/4-y/100+y/400)%7+1;    

 string weekstr="";   

 switch(week)   

 {   

  case 1: weekstr="鏄熸湡涓"; break;   

  case 2: weekstr="鏄熸湡浜"; break;   

  case 3: weekstr="鏄熸湡涓"; break;   

  case 4: weekstr="鏄熸湡鍥"; break;   

  case 5: weekstr="鏄熸湡浜"; break;   

  case 6: weekstr="鏄熸湡鍏"; break;   

  case 7: weekstr="鏄熸湡鏃"; break;   

 }   

 return weekstr;    

}

 

澹版槑: 鏈枃閲囩敤 BY-NC-SA 鍗忚杩涜鎺堟潈 | Carey's Blog
杞浇璇锋敞鏄庤浆鑷.NET涓洓绉嶅叧浜庢樉绀烘槦鏈熷嚑

鏍囩锛,鍒嗙被锛.NET缂栫▼, Web寮鍙, Winform寮鍙
姝ゆ棩蹇楀凡鍏抽棴璇勮锛