منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب
[كود] كود اطفاء برنامج مشغل في التاسك مانجر - نسخة قابلة للطباعة

+- منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب (http://vb4arb.com/vb)
+-- قسم : قسم لغة الفيجوال بيسك VB.NET (http://vb4arb.com/vb/forumdisplay.php?fid=182)
+--- قسم : قسم اسئلة VB.NET (http://vb4arb.com/vb/forumdisplay.php?fid=183)
+--- الموضوع : [كود] كود اطفاء برنامج مشغل في التاسك مانجر (/showthread.php?tid=3635)



كود اطفاء برنامج مشغل في التاسك مانجر - hassan - 14-08-14

السلام عليكم


انا حاب ان اطفي برنامج في التاسك منجر يعني مثال انا مشغل متصفح قوقل كروم ابفا اسوي زر في البرنامج يغلق قوقل كروم



بس هذا

الكود


وشكرا


RE: كود اطفاء برنامج مشغل في التاسك مانجر - silverlight - 14-08-14

Private Sub KillProcess (processName as String )

For Each currentProcess As Process In System.Diagnostics.Process.GetProcessesByName("processName ")
Try
currentProcess.Kill()
' possibly with a timeout
currentProcess.WaitForExit()

Catch winException As Win32Exception ' process was terminating or can't be terminated ...... deal with it
' do something

Catch invalidException As InvalidOperationException ' process has already exited ...... might be able to let this one go
Exit sub
End Try
Next

End Sub


RE: كود اطفاء برنامج مشغل في التاسك مانجر - hassan - 14-08-14

(14-08-14, 10:06 AM)silverlight كتب : Private Sub KillProcess (processName as String )

For Each currentProcess As Process In System.Diagnostics.Process.GetProcessesByName("processName ")
Try
currentProcess.Kill()
' possibly with a timeout
currentProcess.WaitForExit()

Catch winException As Win32Exception ' process was terminating or can't be terminated ...... deal with it
' do something

Catch invalidException As InvalidOperationException ' process has already exited ...... might be able to let this one go
Exit sub
End Try
Next

End Sub
الله يعطيك العافيه بس وين احدد البرنامج الي ابغه يطفي


RE: كود اطفاء برنامج مشغل في التاسك مانجر - silverlight - 14-08-14

مثلا في Button Click ما تكتب كالأتي


KillProcess("اسم البرنامج")