我的代码是
Dim folderPath As String = "D:\con"
If (Not System.IO.Directory.Exists(folderPath)) Then
System.IO.Directory.CreateDirectory(folderPath)
End If
我想要实现的目标是:
con
中创建一个名为D:\
的目录,但会抛出错误Could not find a part of the path 'D:\'.
The specified device name is invalid
为什么不允许创建名为Con
的目录?
答案 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