内容目录
下毒代码如下:
void Main()
{
Value a = 0;
if (a == 1 && a == 2 && a == 3)
{
Console.WriteLine("给代码下点毒");
return;
}
Console.WriteLine("代码无毒");
}
public class Value
{
private int _value;
public Value() { }
public Value(int value)
{
_value = value;
}
public static implicit operator int(Value value)
{
var current = value._value;
value._value += 1;
return current;
}
public static implicit operator Value(int value)
{
return new Value(value);
}
}
文章评论