• 对于同一套应用程序如何发布一个体验版(有部分功能)完整版(有完整功能)


        最近项目中,先做一个版本给用户(普通用户作为体验使用)。之后再有一个完整功能版。

    #define OFFLINE
    using System;
    using System.Collections.Generic;
    using System.Diagnostics;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    
    namespace 完整版_精简版 {
        class Program {
            static void Main(string[] args) {
                MyService service = new MyService();
                service.Testing();
                service.GetInfoFromNet();
                Console.ReadKey();
            }
        }
        
        class MyService {
    
            [Conditional("ONLINE")]
            public void Testing() {
                Console.WriteLine("完整版功能");
            }
    
            [Conditional("OFFLINE")]
            [Conditional("ONLINE")]
            public void GetInfoFromNet() {
                Console.WriteLine("单机版功能");
            }
        }
    }
    

            

           如果需要全局配置的话呢,就可以通过这个来弄。

           

           通过这个,就可以保证我们在项目开发过程中,可能需要一个精简版,和功能完整的版本。

           

  • 相关阅读:
    Python Virtualenv 虚拟环境
    二叉树的左视图和右视图
    Vxlan简介
    2、程序的基本结构
    chef cookbook 实战
    eclipse 搭建ruby环境
    linux 安装软件出现/tmp 磁盘不足时 解决方案
    Python 可变对象与不可变对象
    Chapter 4-5
    Chapter 3
  • 原文地址:https://www.cnblogs.com/gdouzz/p/7128423.html
Copyright © 2020-2023  润新知