vb.net怎么结束进程?
当输入正确的密码后 启动了“数据库管理”子系统 然后关闭子程序 进程还是有一个进程 怎么结束掉?
如何在vb.net里集成一下?
vb.net怎么结束进程?
答案:1 悬赏:10 手机版
解决时间 2021-01-27 16:56
- 提问者网友:活着好累
- 2021-01-26 17:05
最佳答案
- 五星知识达人网友:長槍戰八方
- 2021-01-26 17:56
Imports System
Imports System.Management
Module Module1
Public Sub Main()
Dim service As ManagementObject = New ManagementObject( "win32_service=""winmgmt""")
Dim options As InvokeMethodOptions = New InvokeMethodOptions
options.Timeout = New TimeSpan(0, 0, 0 , 5)
Dim outParams As ManagementBaseObject = service.InvokeMethod("StopService" , Nothing, options)
Console.WriteLine("状态:" & outParams("Returnvalue"))
End Sub
End Module
Imports System.Management
Module Module1
Public Sub Main()
Dim service As ManagementObject = New ManagementObject( "win32_service=""winmgmt""")
Dim options As InvokeMethodOptions = New InvokeMethodOptions
options.Timeout = New TimeSpan(0, 0, 0 , 5)
Dim outParams As ManagementBaseObject = service.InvokeMethod("StopService" , Nothing, options)
Console.WriteLine("状态:" & outParams("Returnvalue"))
End Sub
End Module
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯