惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

M
MIT News - Artificial intelligence
罗磊的独立博客
Hugging Face - Blog
Hugging Face - Blog
J
Java Code Geeks
G
Google Developers Blog
美团技术团队
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
腾讯CDC
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
T
The Blog of Author Tim Ferriss
月光博客
月光博客
B
Blog
WordPress大学
WordPress大学
云风的 BLOG
云风的 BLOG
博客园_首页
人人都是产品经理
人人都是产品经理
aimingoo的专栏
aimingoo的专栏
Y
Y Combinator Blog
Jina AI
Jina AI
S
SegmentFault 最新的问题
H
Help Net Security
博客园 - 聂微东
Microsoft Azure Blog
Microsoft Azure Blog
Google DeepMind News
Google DeepMind News

博客园 - 思然

邮件带图片附件 - 思然 - 博客园 XML查找节点 - 思然 - 博客园 动态生成rdlc 报表(原创) 图片处理 - 思然 - 博客园 数据绑定及其他 - 思然 - 博客园 图片上传及网络相册功能 SQL Server 2005 Express 使用心得 - 思然 附加进程调试和存储过程调试 (转)DIV CSS布局教程:应用ul、li实现表格形式 用户控件的使用经验 缓存之缓存文件依赖及编程方式设置输出缓存过期 防刷新多次提交 添加div符号注意符号问题 Datalist调用本地文件绑定图片 用户控件-TreeView的用法 关于table控件的一个疑难问题(涉及循环) 关于javascript调用webservices的中文参数乱码的问题 服务器端和客户端清除TextBox控件的值 获取母版页的控件的方法
枚举的应用
思然 · 2008-06-13 · via 博客园 - 思然

 GetEmu(CustomerKind.Normal);  
public enum CustomerKind
    {
      Normal = 90,
      Vip = 80,
      SuperVip = 70,
      InActive = 100
    }
//一种是用来判断
 public void GetEmu(CustomerKind c)
    {
        switch (c)
        {
            case CustomerKind.Normal:
                Response.Write((int)CustomerKind.Normal);
                break;
            case CustomerKind.Vip:
                Response.Write((int)CustomerKind.Vip);
                break;
            default:
                Response.Write((int)CustomerKind.InActive);
                break;
        }
    }
//另一种是用来计算

  void bind()
    {
        if (Request.QueryString["id"] == null)
        {

           Response.Write(300/100 * (int)CustomerKind.Normal);
           Response.Write(CustomerKind.Normal);
        }
        else
        {
            Response.Write(CustomerKind.Vip);
            Response.Write(300 / 100 * (int)CustomerKind.Vip);
        }
    }

  void bind()
    {
        if (Request.QueryString["id"] == null)
        {

           Response.Write(300/100 * (int)CustomerKind.Normal);
           Response.Write(CustomerKind.Normal);
        }
        else
        {
            Response.Write(CustomerKind.Vip);
            Response.Write(300 / 100 * (int)CustomerKind.Vip);
        }
    }