在 C# 中,我可以说
#if DEBUG
Console.WriteLine("we are in debug mode");
#else
Console.WriteLine("we are in release mode");
#endif
这对于管理调试和发布版本之间需要不同的事情很方便,例如连接字符串。经典 ASP 中是否有类似的功能?
最佳答案
简短的回答是:不。
但这并不意味着您不能构建自己的调试标志然后使用它。有多种方法可以使用 Application
或 Session
变量来执行此操作。
然后你可以使用它们,例如:
'Application variable should have been set in the global.asa file.
Dim debug: debug = (Application("debug") = True)
If debug Then
'Output some debug information.
Else
'Release mode.
End If
有用的链接
关于c# - 经典 ASP 是否有与 C# 中的 #if DEBUG 语句等效的语句?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57514405/