반응형

* VBNET 다른 응용 프로그램 실행 및 종료 예제...

 

메인 화면

전체 소스 코드

Form1.vb

 

Public Class Form1

    Dim pcEXE As System.Diagnostics.Process


    Private Sub button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button1.Click
        '파일 열기...
        Dim ofd As OpenFileDialog = New OpenFileDialog()

        'EXE 파일만 열기...
        ofd.Filter = "EXE File (*.exe) | *.exe"

        If (ofd.ShowDialog() = Windows.Forms.DialogResult.OK) Then

            label1.Text = ofd.FileName

        End If

    End Sub

    Private Sub button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button2.Click
        '응용 프로그램 실행 시키기...
        '해당 파일이 존재 하지 않으면...
        If Not System.IO.File.Exists(label1.Text) Then
            Return
        End If

        '다른 응용 프로그램 실행 시키기...
        pcEXE = System.Diagnostics.Process.Start(label1.Text)

    End Sub

    Private Sub button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button3.Click
        '응용 프로그램 죽이기...
        If pcEXE Is Nothing Then Return
        '죽이기...
        pcEXE.Kill()
    End Sub

End Class

 

* 예제 결과

 

다른 응용 프로그램 실행 결과 화면

 

 

https://kdsoft-zeros.tistory.com/69

 

[C#] 다른 응용 프로그램 실행 및 종료

* C# 다른 응용 프로그램 실행 및 종료 예제... 전체 소스 코드 Form1.cs using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using Syst..

kdsoft-zeros.tistory.com

 

반응형

+ Recent posts