zoukankan      html  css  js  c++  java
  • 枚举,Enum,常规使用demo记录

    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,
    }



    }
    }

  • 相关阅读:
    《将博客搬至CSDN》
    2015-05-01 至 2015-07-30错误总结
    2015-01-01至2015-04-30错误积累
    2015-07-30 至 2016-03-16错误Note
    2014-11-21错误总结
    Spring 和 SpringMVC 的区别
    spring 容器加载
    Spring注解
    自定义拦截器
    Js闭包
  • 原文地址:https://www.cnblogs.com/linbin524/p/4767120.html
Copyright © 2011-2022 走看看