是否可以在一行代码中简化这一过程?
感谢。
public static string BuildAutoLoginUrl(string username)
{
#if DEBUG
return @"/Account/AutoLogin?key=" + GetAutoLoginKey(username);
#else
return @"http://www.domain.com/Account/AutoLogin?key=" + GetAutoLoginKey(username);
#endif
}
答案 0 :(得分:-1)
根据the documentation for C# preprocessor directives,它说明如下:
预处理程序指令必须是一行上的唯一指令。
因此答案是否定的,不可能将代码减少到一行。