牛魔王的故事
chdir函数: Visual Basic 语言参考 ChDir 函数 更改当前目录或文件夹。 在文件 I/O 操作中,My 功能具有比 ChDir 函数更高的效率和更好的性能。有关更多信息,请参见 My.Computer.FileSystem.CurrentDirectory 属性。 Public Sub ChDir(ByVal Path As String) 参数: Path 必选。String 表达式,标识哪一个目录或文件夹变成新的默认目录或文件夹。Path 可能包含驱动器。如果未指定驱动器,则 ChDir 更改当前驱动器上的默认目录或文件夹。 示例: 此示例使用 ChDir 函数更改当前目录或文件夹。 Visual Basic 复制代码 ' Change current directory or folder to "MYDIR". ChDir("MYDIR") ' Assume "C:" is the current drive. The following statement changes ' the default directory on drive "D:". "C:" remains the current drive. ChDir("D:\WINDOWS\SYSTEM")