1. 程式人生 > >C#獲取星期幾的函式,asp.net獲取星期

C#獲取星期幾的函式,asp.net獲取星期

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
///week 的摘要說明
/// </summary>
public class week
{
    public static string Geteek()
    {
            string[] weekdays = { "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六" };
            string week = weekdays[Convert.ToInt32(DateTime.Now.DayOfWeek)];
            return week;
    }

}