| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 730 人关注过本帖
标题:请问 switch ()获取当前日期怎么写
只看楼主 加入收藏
助人为乐
Rank: 1
等 级:新手上路
帖 子:54
专家分:0
注 册:2007-3-9
收藏
 问题点数:0 回复次数:2 
请问 switch ()获取当前日期怎么写
switch ()
            {
                case "Mon":
                    Console.WriteLine("今天是星期一,学英语");
                    break;

                case "Tur":
                    Console.WriteLine("今天是星期二,学画画");
                    break;

                case "Wed":
                    Console.WriteLine("今天是星期三,学音乐");
                    break;

                case "Thu":
                    Console.WriteLine("今天是星期四,学数学");
                    break;

                case "Fri":
                    Console.WriteLine("今天是星期五,学舞蹈");
                    break;

                default:
                    Console.WriteLine("今天是星期日,放假休息");
                    break;
            }
搜索更多相关主题的帖子: switch 获取 
2007-12-21 15:25
multiple1902
Rank: 8Rank: 8
等 级:贵宾
威 望:42
帖 子:4881
专家分:671
注 册:2007-2-9
收藏
得分:0 
哪点上和asp有关?
2007-12-21 15:55
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
收藏
得分:0 
switch (DateTime.Now.DayOfWeek)//DateTime.Now.DayOfWeek获得系统日期的星期几
 {
              //DayOfWeek枚举值
              case DayOfWeek.Monday:
                    Console.WriteLine("今天是星期一,学英语");
                    break;

                case DayOfWeek.Tuesday:
                    Console.WriteLine("今天是星期二,学画画");
                    break;

                case DayOfWeek.Wednesday:
                    Console.WriteLine("今天是星期三,学音乐");
                    break;

                case DayOfWeek.Thursday:
                    Console.WriteLine("今天是星期四,学数学");
                    break;

                case DayOfWeek.Friday:
                    Console.WriteLine("今天是星期五,学舞蹈");
                    break;

                case DayOfWeek.Sunday:
                    Console.WriteLine("今天是星期日,放假休息");
                    break;
}
2007-12-21 17:20
快速回复:请问 switch ()获取当前日期怎么写
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.091370 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved