对于可删除的驱动器,不需要将媒体插入其中,它就可以在Drives集合中显示出来。 下面的代码举例说明了如何获得 Drives 集合,以及如何用 For Each...Next 语句来访问该集合中的每个Drive: Sub ShowDriveList Dim fs, d, dc, s, n Set fs = CreateObject("scr ipting.FileSystemObject") Set dc = fs.Drives For Each d in dc s = s & d.Drive
发布2个字符串处理函数: 1、ParameterValue() 2、ParameterCount() 用法示例: dim TheString as String TheString="欢迎,光临,枕善居,源代码" msgbox ParameterCount(",",TheString) 返回 4 ParameterValue(",",TheString,2) 返回 "欢迎" Public Function ParameterCount(ParseCharacter As String, _ t
Function RegExpTest(patrn, strng) Dim regEx, Matches Set regEx = New RegExp regEx.Pattern = patrn regEx.IgnoreCase = True ‘为真则忽略大小写,否则严格匹配大小写 regEx.Global = True Set Matches = regEx.Execute(strng) RegExpTest = Matches.count End Function MsgB