码迷,mamicode.com
首页 > 编程语言 > 详细

枚举,Enum,常规使用demo记录

时间:2015-08-28 19:21:27      阅读:209      评论:0      收藏:0      [点我收藏+]

标签:

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

namespace MvcEnum.Controllers
{
public class HomeController : Controller
{
public ActionResult Index()
{
//int t=(int)TypeStyle.类型;

/////根据枚举的值获取对应的名称
//TypeStyle t1 = (TypeStyle)1;

//TypeStyle t2 = (TypeStyle)2;
//TypeStyle t3 = (TypeStyle)3;



//ViewBag.Message = t3 +"//"+ t2+"//"+t3 + "修改此模板以快速启动你的 ASP.NET MVC 应用程序。";

int t = (int)TypeStyle.类型;
TypeStyle t1 = (TypeStyle)t;
ViewBag.Message = t1 + t + "修改此模板以快速启动你的 ASP.NET MVC 应用程序。";

return View();
}

public ActionResult About()
{
ViewBag.Message = "你的应用程序说明页。";

return View();
}

public ActionResult Contact()
{
ViewBag.Message = "你的联系方式页。";

return View();
}


public enum TypeStyle{

类型=1,
周期=2,
判断=3,
}



}
}

枚举,Enum,常规使用demo记录

标签:

原文地址:http://www.cnblogs.com/linbin524/p/4767120.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!