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 で表示されることです。これは正しいですが、5 月を表示する必要があります。どうすればいいですか?