Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有五种颜色的数组,我想每天在标题中旋转进出。我将如何在 C# 中在语法上执行此操作?我可以很容易地用 Javascript 编写它,但不能用 C# 编写。
您可以使用一年中的当前日期作为旋转颜色的方式。
var color = colors[DateTime.Now.DayOfYear % 5];