名称:快速切换天财商龙门店后台
作者:landv
时间:2015年8月21日
功能:快速切换天财商龙门店后台
环境:VB6.0
注:懒的一行一行修改文件了,直接覆盖配置文件,Tcgem.ini
只能反编译喽,delphi7开发的东东。直接跳过伺服,省得IP不统一,没法使用。
1 Private Type PROCESSENTRY32 2 dwSize As Long 3 cntUsage As Long 4 th32ProcessID As Long 5 th32DefaultHeapID As Long 6 th32ModuleID As Long 7 cntThreads As Long 8 th32ParentProcessID As Long 9 pcPriClassBase As Long 10 dwFlags As Long 11 szExeFile As String * 260 12 End Type 13 Private Declare Function CreateToolhelp32Snapshot Lib "kernel32" (ByVal dwFlags As Long, ByVal th32ProcessID As Long) As Long 14 Private Declare Function Process32First Lib "kernel32" (ByVal hSnapShot As Long, lppe As PROCESSENTRY32) As Long 15 Private Declare Function Process32Next Lib "kernel32" (ByVal hSnapShot As Long, lppe As PROCESSENTRY32) As Long 16 Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal blnheritHandle As Long, ByVal dwAppProcessId As Long) As Long 17 Private Declare Function TerminateProcess Lib "kernel32" (ByVal ApphProcess As Long, ByVal uExitCode As Long) As Long 18 Private Declare Sub CloseHandle Lib "kernel32" (ByVal hPass As Long) 19 Private Const TH32CS_SNAPPROCESS = &H2& 20 Private Sub KillProcess(sProcess As String) 'kill进程 21 Dim lSnapShot As Long 22 Dim lNextProcess As Long 23 Dim tPE As PROCESSENTRY32 24 lSnapShot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0&) 25 If lSnapShot <> -1 Then 26 tPE.dwSize = Len(tPE) 27 lNextProcess = Process32First(lSnapShot, tPE) 28 Do While lNextProcess 29 If LCase$(sProcess) = LCase$(Left(tPE.szExeFile, InStr(1, tPE.szExeFile, Chr(0)) - 1)) Then 30 Dim lProcess As Long 31 Dim lExitCode As Long 32 lProcess = OpenProcess(1, False, tPE.th32ProcessID) 33 TerminateProcess lProcess, lExitCode 34 CloseHandle lProcess 35 End If 36 lNextProcess = Process32Next(lSnapShot, tPE) 37 Loop 38 CloseHandle (lSnapShot) 39 End If 40 End Sub 41 42 Private Sub Command1_Click(Index As Integer) 43 Label1.Caption = "目前切换状态:三丰" 44 FileCopy App.Path & "\landv\三丰\Tcgem.ini", App.Path & "\Tcgem.ini" 45 Call KillProcess("pTCB.exe") 46 Dim str 47 str = App.Path '将当前路径赋给字符串 48 Shell str & "\pTCB.exe" '打开pTCB.exe软件 49 50 End Sub 51 52 Private Sub Command2_Click() 53 Label1.Caption = "目前切换状态:中银" 54 FileCopy App.Path & "\landv\中银\Tcgem.ini", App.Path & "\Tcgem.ini" 55 Call KillProcess("pTCB.exe") 56 Dim str 57 str = App.Path '将当前路径赋给字符串 58 Shell str & "\pTCB.exe" '打开pTCB.exe软件 59 End Sub 60 61 Private Sub Command3_Click() 62 63 Label1.Caption = "目前切换状态:裕华" 64 FileCopy App.Path & "\landv\裕华\Tcgem.ini", App.Path & "\Tcgem.ini" 65 Call KillProcess("pTCB.exe") 66 Dim str 67 str = App.Path '将当前路径赋给字符串 68 Shell str & "\pTCB.exe" '打开pTCB.exe软件 69 End Sub 70 71 Private Sub Command4_Click() 72 Label1.Caption = "目前切换状态:小厨" 73 FileCopy App.Path & "\landv\小厨\Tcgem.ini", App.Path & "\Tcgem.ini" 74 Call KillProcess("pTCB.exe") 75 Dim str 76 str = App.Path '将当前路径赋给字符串 77 Shell str & "\pTCB.exe" '打开pTCB.exe软件 78 End Sub 79 80 Private Sub Command5_Click() 81 82 Label1.Caption = "目前切换状态:红旗" 83 FileCopy App.Path & "\landv\红旗\Tcgem.ini", App.Path & "\Tcgem.ini" 84 Call KillProcess("pTCB.exe") 85 Dim str 86 str = App.Path '将当前路径赋给字符串 87 Shell str & "\pTCB.exe" '打开pTCB.exe软件 88 End Sub 89 90 Private Sub Command6_Click() 91 Label1.Caption = "目前切换状态:秀兰" 92 FileCopy App.Path & "\landv\秀兰\Tcgem.ini", App.Path & "\Tcgem.ini" 93 Call KillProcess("pTCB.exe") 94 Dim str 95 str = App.Path '将当前路径赋给字符串 96 Shell str & "\pTCB.exe" '打开pTCB.exe软件 97 End Sub 98 99 Private Sub Command7_Click() 100 101 Label1.Caption = "目前切换状态:北大" 102 FileCopy App.Path & "\landv\北大\Tcgem.ini", App.Path & "\Tcgem.ini" 103 Call KillProcess("pTCB.exe") 104 Dim str 105 str = App.Path '将当前路径赋给字符串 106 Shell str & "\pTCB.exe" '打开pTCB.exe软件 107 End Sub 108 109 Private Sub Command8_Click() 110 Label1.Caption = "目前切换状态:小鱼" 111 FileCopy App.Path & "\landv\小鱼\Tcgem.ini", App.Path & "\Tcgem.ini" 112 Call KillProcess("pTCB.exe") 113 Dim str 114 str = App.Path '将当前路径赋给字符串 115 Shell str & "\pTCB.exe" '打开pTCB.exe软件 116 End Sub