无法创建文件夹:无法找到路径'D:\'的一部分

时间:2014-11-24 07:04:27

标签: asp.net vb.net directory

我的代码是

 Dim folderPath As String = "D:\con"
 If (Not System.IO.Directory.Exists(folderPath)) Then
    System.IO.Directory.CreateDirectory(folderPath)
 End If

我想要实现的目标是:

  1. con中创建一个名为D:\的目录,但会抛出错误Could not find a part of the path 'D:\'.
  2. 然后我尝试手动在文件资源管理器中创建相同的内容,它再次抛出错误The specified device name is invalid
  3. 为什么不允许创建名为Con的目录?

1 个答案:

答案 0 :(得分:0)

NUL, AUX, CON, COM1-4, LPT1-3, and PRN

是用于DOS设备的保留字

这些在IO.SYS中指定,并且可以追溯到早期的MS Dos天。这是一个简短的清单:

CLOCK$ - System clock
CON - Console; combination of keyboard and screen to handle input and output
AUX or COM1 - First serial communicationport
COMn - Second, Third, ... communicationport
LPT1 or PRN - First parallel port
NUL - Dummy port, or the "null device" which we all know under Linux as /dev/null.
CONFIG$ - Unknown