快一个,为什么这个代码心不是为我工作:日期为文件夹名称
Directory.CreateDirectory(DateTime.ToString("dd-MM-yyyy"));
Erorr:
Error 1 An object reference is required for the non-static field, method, or property 'System.DateTime.ToString(string)' Documents\Visual Studio 2008\Projects\WindowsFormsApplication1\WindowsFormsApplication1\Form1.cs 83 39 WindowsFormsApplication1
有什么不对?如果我想将文件夹名称命名为“This is folder of”,然后添加今天的日期,它应该如何显示?
尝试简单的表达式'DateTime.ToString(“dd-MM-yyyy”)' - 会发生什么? –