这是代码:
namespace Testing
{
public partial class Form1 : Form
{
private string contentDirectory = "";
public Form1()
{
InitializeComponent();
string[] filesContent = Directory.GetFiles(@"c:\windows\minidump\");
string currentDate = DateTime.Now.ToShortDateString();
contentDirectory = Path.GetDirectoryName(Application.LocalUserAppDataPath) + "\\WM_" + currentDate;
Directory.CreateDirectory(contentDirectory);
}
我最终想要得到的是这样的目录名称:
C:\Users\bout0_000\AppData\Local\Testing\Testing\WM_27-03-13
相反,我现在得到的是:
C:\Users\bout0_000\AppData\Local\Testing\Testing\WM_\23\97\13
这是为什么 ?
以及如何将当前日期格式化为 : 27-03-13 and not 27/03/13
?