16,555
社区成员
发帖
与我相关
我的任务
分享
Dim current As Process
current = Process.GetCurrentProcess
Dim processes As Process() = Process.GetProcessesByName(current.ProcessName)
'查找相同名的进程
Dim tmpProcess As Process
For Each tmpProcess In processes
'忽略当前进程
If tmpProcess.Id <> current.Id Then
'确认相同名的进程运行位置是否相同
If Reflection.Assembly.GetExecutingAssembly().Location.Replace("/", "\") = current.MainModule.FileName Then
'返回其它的运行实例
MsgBox("yes")
End If
End If
Next tmpProcess
'没有其它实例,返加空值
MsgBox("no")