问题描述
在C#程序中,我正在创建DirectoryInfo的实例。通常,在目录名称之后似乎不需要尾部斜杠。但是,如果我传入"C:",而不是获取我的硬盘驱动器的根目录,我得到
我的可执行文件所在的目录!这当然看起来像一个bug,但是我有一些隐藏的行为,我错过了吗?< object data-extension-version =" 0.5.0.161"数据安装-更新用户配置= QUOT;真"数据载体香精配置= QUOT;真"
id =" __ symantecPKIClientMessenger" style =" display:none;">< / object>
In a C# program I am creating an instance of DirectoryInfo. Normally it does not seem to require a trailing slash after a directory name. But if I pass in "C:", rather than getting the root directory for my hard drive I get the directory where my executable is! This certainly seems like a bug but is there some hidden behavior that I am missing?<object data-extension-version="0.5.0.161" data-install-updates-user-configuration="true" data-supports-flavor-configuration="true" id="__symantecPKIClientMessenger" style="display:none;"></object>
这篇关于DirectoryInfo构造函数中的错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!