老兄,你要思考
例如說HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoDriveTypeAutoRun
你要得到第3個吧
Dim a As String
Dim i As String
a = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoDriveTypeAutoRun"
'
MsgBox Right(a, Len(a) - InStrRev(a, "\"))
i = 1
Do While i < 3
a = Right(a, Len(a) - InStr(a, "\"))
i = i + 1
Loop
MsgBox Left(a, InStr(a, "\") - 1)
Do While i < 3(如果你要取第四個,把這裡3改成4)