这段代码是什么意思?

时间:2011-05-21 08:55:06

标签: .net vb.net

这段代码是什么意思?将代码转换为安装文件时有什么影响?

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")

2 个答案:

答案 0 :(得分:1)

看起来代码在Windows注册表中注册了一个扩展,并将应用程序与它相关联。

答案 1 :(得分:1)

两个片段都写入注册表的HKeyCurrentUser部分。

HKCR

HKCU