본문 바로가기
카테고리 없음

Process Kill

by 호야호잇 2018. 8. 3.

 '프로세스 종료

    Public Function Process_Kill(ByVal ProcessName As String) As Boolean

        Try

            Dim GetProcess As System.Diagnostics.Process() = Diagnostics.Process.GetProcessesByName(ProcessName)

            If GetProcess.Length = 0 Then    '실행중인 프로세스가 아니면

                Return False

            Else

                GetProcess(0).Kill()

                Return True

            End If

        Catch ex As Exception

            Return False

        End Try


    End Function