-2
我正在將現有的vb應用程序轉換爲.net,在現有代碼中我找到了以下條件。如何在C#中編寫此條件?由於提前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#中編寫此條件?由於提前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
好感謝一個lot.it爲我工作:) –