#if, #else, #endif in C# source code

前端 未结 2 1244
温柔的废话
温柔的废话 2021-01-14 02:10

I\'ve got a sample code from MSDN and I\'ve found code syntax I\'ve never seen before:

namespace Mvc3RemoteVal.Controllers 
{
        public class HomeContro         


        
2条回答
  •  孤街浪徒
    2021-01-14 02:47

    These are not new features for Framework 4

    this are features you can use for development stage and testing: you can declare:

    #Define something
    

    and then

    #if something
    

    all the code that is in that "if" will be executed. all the code that isn't, won't.

提交回复
热议问题