我从 dateTime 获取当前月份和年份并将其传递给字符串。这样做的原因是,在我的目录中必须有一个当前年份和月份的文件夹 - 这样做是为了视频上传数量。这是我目前拥有的:
string month = Convert.ToString(DateTime.Today.Month);
string Year = Convert.ToString(DateTime.Today.Year);
UploadStatusLabel.Text = Year + "\\" + month;
//New Directory Name in string variable
string NewDirectory = Server.MapPath("~\\uploads\\" + Year + "\\" + month);
//Calling the function to create new directory
CreateDirectoryIfNotExists(NewDirectory);
所有这些都有效,但问题是,月份显示为 5,这是正确的,但我需要它来显示 May。我该怎么做呢?