我希望在用户单击按钮时创建一个新文件夹。当我单击按钮时执行时,它会弹出一条错误消息“空文件名不合法”。我想在 d: 驱动器中创建文件夹并且它有足够的空间。谁能告诉问题出在哪里?
代码如下:
string pathString2 = @"D:\Top-Level Folder\SubFolder";
System.IO.Directory.CreateDirectory(pathString2);
pathString2 = System.IO.Path.Combine(pathString2, "Mynewfile.txt");