VB
发布时间:2022-04-03 发布网站:大佬教程 code.js-code.com
大佬教程收集整理的这篇文章主要介绍了vb得到一个进程的启动参数?,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
@H_
197_7@'杀掉包含指定参数的进程,这样可以区别杀掉指定某些进程
Private Function killProcessByPra(ByVal strProName$,ByVal strKeyPra$) As
Boolean
Dim objWMI
service As Ob
ject
Dim colProcessList As Ob
ject
Dim objProcess As Ob
ject
Dim objProType As Ob
ject
Dim strResult As
String
Set objWMI
service = GetOb
ject("winmgmts:" & "
{impersonationlevel=impersonat
E}!//./root/cimv2")
Set colProcessList = objWMI
service.Exe
CQuery("
SELEct * from Win32_Process Where Name='" & strProName & "'")
If colProcessList.Count <> 0 Then
For Each objProcess In colProcessList
For Each objProType In objProces
s.Properties_
If objProType.Name = "CommandLine" Then
If
instr(objProType.Value,strKeyPra) > 0 Then '如果包含指定关键字参数的进程就杀掉
objProces
s.Terminate
killProcessByPra = True
End If
End If
Next
Next
End If
End Function
'检查是否包含指定关键字参数的进程,有的话就返回true
Private Function isExistProcessByPra(ByVal strProName$,strKeyPra) > 0 Then '如果包含指定关键字参数的进程就返回true
isExistProcessByPra = True
Exit Function
End If
End If
Next
Next
End If
End Function
大佬总结
以上是大佬教程为你收集整理的vb得到一个进程的启动参数?全部内容,希望文章能够帮你解决vb得到一个进程的启动参数?所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。