2011-05-21 220 views
-1

這段代碼是什麼意思? 當我將代碼轉換爲setuo文件時會產生什麼影響?這段代碼是什麼意思?

Dim W As Object 
     Dim E As String 
     W = CreateObject("Wscript.shell") 
     If VB.Left(Extension, 1) <> "." Then 
      E = "." & Extension & "\" 
     Else 
      E = Extension & "\" 
      Extension = Mid(Extension, 2) 
     End If 
     W.regwrite("HKCU\" & E, Extension & " File") 
     W.regwrite("HKCU\" & Extension & " File\", Description) 
     W.regwrite("HKCU\" & Extension & " File\DefaultIcon\", FileIcon) 
    W.regwrite("HKCU\" & Extension & " File\Shell\Open\Command\", ProgramPath & " %1") 
     W.regwrite("HKCU\" & Extension & " File\Shell\", "Open") 
    End Sub 

這是什麼意思?

W.regwrite("HKCU\" & Extension & " File\Shell\Open\Command\", ProgramPath & " %1") 

回答

1

看起來代碼是在Windows註冊表中註冊一個擴展名,並將應用程序與它關聯。

1

這兩個片段正在寫入註冊表的HKeyCurrentUser部分。

HKCR

HKCU

+0

什麼差異HKCU和HKCR之間?在什麼情況下我選擇鑰匙? – hellen 2011-05-21 09:19:24