VB.net进程处理应用:使用进程运行其他的文件(等同vb的shell)。

作者:袖梨 2022-07-02
Dim myProcess As New Process() '先定义一个进程变量
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        myProcess.StartInfo.FileName = "Notepad"
        myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Maximized
        myProcess.Start()
    End Sub
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        myProcess.CloseMainWindow() '关闭进程
    End Sub

相关文章

精彩推荐