程序自我销毁(vb)
Form窗体:--------------------------------------------------------------------
Private Sub Form_Load()
Me.Hide
'可以在这中间插入你需要程序增加的功能和指令
Call KillMe
End
End Sub
---------------------------------------------------------------------
Module代码:
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
del 感觉差不多 {:1_900:}强大啊!!!是格盘么? 渣渣表示看不明,求大牛{:301_1004:} 延时删除自身 VB自毁,看一下 本帖最后由 iamprole 于 2014-10-24 09:10 编辑
执行个批处理删除程序文件吧。很久没玩VB了。 这是有多么厉害啊
页:
[1]
2