源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

VBS教程:方法-GetDriveName 方法

  • 时间:2020-12-17 22:56 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:VBS教程:方法-GetDriveName 方法

GetDriveName 方法

返回包含指定路径中驱动器名的字符串。 [code][i]object.[/i][b]GetDriveName[/b][i](path) [/i][/code] [h3]参数[/h3]object 必选项。应为 FileSystemObject 的名称。 path 必选项。指定路径,要返回其组成部分的驱动器名。 [h3]说明[/h3]如果无法确定驱动器,则 [b]GetDriveName[/b] 方法返回零长度字符串 ("")。 下面例子举例说明如何使用[b]GetDriveName[/b] 方法:
[code] Function GetAName(DriveSpec)  Dim fso  Set fso = CreateObject("Scripting.FileSystemObject")  GetAName = [b]fso.GetDriveName([/b]Drivespec[b])[/b]End Function[/code]
[b]注意  [/b] [b]GetDriveName[/b] 方法只能对提供 [i]path[/i] 的字符串起作用。它不能试图分析一个路径,也不能检查指定路径是否存在。
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部