查找程序是否已经运行的三种方法:

PirateNOX PirateNOX 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
查找程序是否已经运行的三种方法: 1. If Ubound(Diagnostics.Process.GetProcessesByName(Diagnostics.Process.GetCurrentProcess.ProsseName))>0 then messagebox.show("程序正在运行!") end if 2. Dim ps As new Process For Each ps In Diagnostics.Process.GetProcesses If pro.ProcessName = "进程名称" Then messagebox.show("程序正在运行!") End If Next 3. '写一个功能。 Function FindProcess(ProcessName) As Boolean Dim ps '枚举进程 For Each ps In GetObject("winmgmts:\\.\root\cimv2:win32_process").instances_ '循环进程 If UCase(ps.Name) = UCase(ProcessName) Then FindProcess = True Exit Function End If Next End Function ,=以下调用过程 If FindProcess("xxxx.exe") Then '在此修改为你要找的程序名 MsgBox.show ("该程序正在运行!") Else MsgBox .show("该程序不正在运行!") End If
...全文

相关推荐

评论 2
收藏 已收藏
分享
返回顶部
PirateNOX
资源 1,065 成员 6,492 内容