【发布时间】:2016-04-25 11:45:03
【问题描述】:
我正在将现有的 vb 应用程序转换为 .net,在现有代码中我找到了以下条件。如何在 C# 中编写此条件?提前致谢
if CLng(Right(request("yr"),4))=CLng(Year(Date())) then
//I am confused only in Year(Date()) how can I replace these functions in C#
【问题讨论】:
我正在将现有的 vb 应用程序转换为 .net,在现有代码中我找到了以下条件。如何在 C# 中编写此条件?提前致谢
if CLng(Right(request("yr"),4))=CLng(Year(Date())) then
//I am confused only in Year(Date()) how can I replace these functions in C#
【问题讨论】:
Year(Date())可以写成DateTime.Now.Year
【讨论】: