Switch

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Asp.net练习
{
class Program
{
static void Main(string[] args)
{

string dt = DateTime.Now.DayOfWeek.ToString();
Console.WriteLine("当前时间为:" + Time(dt));
Console.ReadKey();
}
public string DayOfWeek { get; set; }
public static string Time(string dt)
{
switch (dt)
{
case "Monday":
dt = "星期一";
break;
case "Tuesday":
dt = "星期二";
break;
case "Wedensday":
dt = "星期三";
break;
case "Thursday":
dt = "星期四";
break;
case "Friday":
dt = "星期五";
break;
case "Saturday":
dt = "星期六";
break;
case "Sunday":
dt = "星期日";
break;
}
return dt;
}

}
}

posted @ 2018-07-29 14:49  你的斗志并没有失去  阅读(174)  评论(0编辑  收藏  举报