none
不用API,也能玩注册表 RRS feed

  • 常规讨论

  • ****************************************************
    '请务必引用 “Windows Script Host Object Model" Lib
    '
    '****************************************************
    '
    '****************************************************
    ' Note:
    '
    '需引用“Windows Script Host Object Model" Lib
    '"HKLM" 指 "HKEY_LOCAL_MACHINE"
    '"HKCU" 指 "HKEY_CURRENT_USER"
    '其它几个注册表主键依次类推,但必须大写
    '适用于vb 6 简体中文版
    '
    '******************************************************
    ' by Downmoon
    '
    ' QQ: 23409408
    '
    ' 1000sun@163.com
    '
    ' 2003-2-16
    '
    '*****************************************************


    Option Explicit
    Dim mynumber As Integer
    Private Reg





    Private Sub del_reg_Click()
    Dim Cancel As Integer
    Dim mydelete As String
    If MsgBox("Are u sure to delete" & vbTab & "HKLMSOFTWARERisingRavMyRising" & vbTab & "?", vbYesNo, "确认前先保存注册表!!!") = vbNo Then
    Cancel = True
    Else

    mydelete = Reg.RegDelete("HKLMSOFTWARERisingRavMyRising")


    MsgBox " Already Deleted!!!!" & vbTab & Chr(13) & "HKLMSOFTWARERisingRavMyRising==== D:risingRavRav.exe"
    End If


    End Sub


    Private Sub Form_Load()
    mynumber = 0
    Set Reg = New IWshShell_Class
    End Sub





    Private Sub Form_Unload(Cancel As Integer)
    ilovedownmoon.Caption = "再见"
    If ilovedownmoon.WindowState <> 1 Then
    Dim I As Long
    For I = 50 To ilovedownmoon.Height
    If ilovedownmoon.Height > 400 Then
    ilovedownmoon.Height = ilovedownmoon.Height - 30
    End If
    Next I
    For I = 50 To ilovedownmoon.Width
    If ilovedownmoon.Width > 500 Then
    ilovedownmoon.Width = ilovedownmoon.Width - 30
    End If
    Next I
    End If
    End
    End Sub


    Private Sub read_reg_Click()
    MsgBox ("happy.gif! Your rising ID is :" & Chr(13) & Chr(13) & Chr(13) & vbTab & Reg.RegRead("HKLMSOFTWARERisingRavNetID") & Chr(13) & Chr(13) & Chr(13) & Chr(13) & vbTab & "OK?")
    End Sub



    Private Sub reg_run_Click()
    On Error Resume Next


    Dim myrun As String
    Dim mynorun As String



    If mynumber 2 = 0 Then



    myrun = Reg.RegWrite("HKLMSOFTWAREMicrosoftWindowsCurrentVersionRuncdplayer", "C:WINNTsystem32cdplayer.exe", "REG_SZ")
    MsgBox (Chr(13) & vbTab & "added " & Chr(13) & vbTab & vbTab & "C:WINNTsystem32cdplayer.exe" & Chr(13) & vbTab & "into AutoRun!")
    reg_run.Caption = "取消自运行"
    '测试
    'Label1.Caption = mynumber
    GoTo num


    Else
    mynorun = Reg.RegDelete("HKLMSOFTWAREMicrosoftWindowsCurrentVersionRuncdplayer")
    MsgBox (Chr(13) & vbTab & "Deleted " & Chr(13) & vbTab & vbTab & "C:WINNTsystem32cdplayer.exe" & Chr(13) & vbTab & "out of AutoRun!")
    reg_run.Caption = "启动自运行"
    '测试
    'Label1.Caption = mynumber
    GoTo num


    End If

    num:
    mynumber = mynumber + 1





    End Sub


    Private Sub write_reg_Click()
    Dim Cancel As Integer
    Dim mytest As String
    If MsgBox("Really write" & vbTab & "HKLMSOFTWARERisingRavMyRising" & vbTab & "?", vbYesNo, "确认前先保存注册表!!!") = vbNo Then
    Cancel = True
    Else
    mytest = Reg.RegWrite("HKLMSOFTWARERisingRavMyRising", "D:risingRavRav.exe", "REG_SZ")
    'REG_SZ 表示键的类型,为缺省值。
    MsgBox "HKLMSOFTWARERisingRavMyRising==== D:risingRavRav.exe" & vbTab & Chr(13) & "Writed!!!!!"


    End If
    End Sub
    2009年5月27日 8:06