条件编译怎么用

喜爱糖葫芦 / 2023-05-23 / 原文

提问

条件编译怎么用

回答

在代码开始添加
`

define v2.0,0

`
在方法上添加特性

[Conditional("v2.0.0")] public void HelloWorld(){}

参考