程序自我銷毀(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

本文出自 “Vic” 博客,轉載請與作者聯系!


注意!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系我们删除。



 
粤ICP备14056181号  © 2014-2020 ITdaan.com