在研发登入器的时候 往往会遇到更新登录器,这个时候 需要把自身的原始登录器 销毁掉,可以用下面的代码。
Private Declare Function GetModuleFileName Lib "kernel32" Alias "GetModuleFileNameA" (ByVal hModule As Long, ByVal lpFileName As String, ByVal nSize As Long) As Long
Private Declare Sub ExitProcess Lib "kernel32" (ByVal uExitCode As Long)
Public Sub KillMe() '删除自身
Dim MyFilename As String
Dim tmp As String * 255
Dim l As Integer
l = GetModuleFileName(0, tmp, 255)
MyFilename = Mid(tmp, 1, l)
Shell "cmd /c ping 127.0.0.1 -n 1 && del """ & MyFilename & """", vbHide
ExitProcess (0)
End Sub