一段检测当前进程是否已经在运行了的代码,非常实用!
来源:互联网 发布:淘宝适合卖什么 编辑:程序博客网 时间:2024/05/17 05:13
Private Function IsAlreadyRunningInstance() As Boolean
Dim current As process = System.Diagnostics.Process.GetCurrentProcess()
Dim processes As process() = System.Diagnostics.Process.GetProcessesByName(current.ProcessName)
'Loop through the running processes in with the same name
Dim process As process
For Each process In processes
'Ignore the current process
If process.Id <> current.Id Then
'Make sure that the process is running from the exe file.
If [Assembly].GetExecutingAssembly().Location.Replace("/", "/") = current.MainModule.FileName Then
'Return true.
Return True
End If
End If
Next process
'No other instance was found, return false.
Return False
End Function
- 一段检测当前进程是否已经在运行了的代码,非常实用!
- 如何检测系统是否已经运行了相同的程序。
- 检测系统是否已经运行了相同的程序
- 如何检测系统是否已经运行了相同的程序
- JAVA检测指定的进程是否在运行
- JAVA检测指定的进程是否在运行(转)
- JAVA检测指定的进程是否在运行
- 在系统中检测指定的窗口是否已经打开,检查某进程是否存在
- 在系统中检测指定的窗口是否已经打开,检查某进程是否存在
- vb检测进程是否在运行
- 检测指定进程是否在运行
- 代码检测vc2013环境是否已经安装了
- Linux下通过进程名检测进程是否在运行
- 检测当前程序是否运行
- C# 检测程序是否已经运行
- WINCE检测进程是否运行
- WINCE 检测 进程是否运行
- IsDebuggerPresent() 函数检测进程是否运行在调试器的控制下
- ITIL介绍及应用案例(二)
- ITIL介绍及应用案例(三)
- ITIL介绍及应用案例(四)
- 在.Net安装文件中包含.Net Framework和MDAC 2.7
- 过不悔的大学生活
- 一段检测当前进程是否已经在运行了的代码,非常实用!
- vc 透明显示位图
- MYSQL初学者使用指南
- tomcat 详解+补充
- Struts常见错误及原因分析
- 第4章 初始化与清除
- ceil ( ) 【C语言库函数源代码】
- floor ( )【C语言库函数源代码】
- 用log4j解决java相对路径问题