Vb.net 如何在VisualBasic中确定进程何时完成?

Vb.net 如何在VisualBasic中确定进程何时完成?,vb.net,Vb.net,我已经编写了一个程序,在经过一段时间后执行了一些代码 问题是我需要这项工作在另一项工作之后开始。我的意思是让他们在第一个结束后按顺序执行(即,第二个开始,然后第三个…) 对不起我的英语:(我希望你明白我想要什么 这是我的密码: Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick Dim tte1 As String = Replace(TextBox1.Text, "?", "")

我已经编写了一个程序,在经过一段时间后执行了一些代码

问题是我需要这项工作在另一项工作之后开始。我的意思是让他们在第一个结束后按顺序执行(即,第二个开始,然后第三个…)

对不起我的英语:(我希望你明白我想要什么

这是我的密码:

Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick

    Dim tte1 As String = Replace(TextBox1.Text, "?", "")
    Dim tte2 As String = Replace(tte1, "/", "")
    Dim tte3 As String = Replace(tte2, ":", "")
    Dim tte4 As String = Replace(tte3, "xxx", "")
    Dim tte5 As String = Replace(tte4, "?", "")
    Dim file = My.Computer.FileSystem.SpecialDirectories.Temp & "\" + tte5
    Dim file1 = My.Computer.FileSystem.SpecialDirectories.Temp & "\" + tte5 + ".system"



    Dim cryptor As FileEncryption = New FileEncryption()
    cryptor.SetPassword("xxxx")

    If My.Computer.FileSystem.FileExists(file) Then
        System.IO.File.Delete(file1)

        Try
            cryptor.Encrypt(file, file1)


            sendfile(file1, xxxx)
            System.IO.File.Delete(file)
            System.IO.File.Delete(file1)

        Catch ex As Exception



        End Try
    End If
    Try
        My.Computer.Clipboard.Clear()
    Catch ex As Exception


    End Try
End Sub
正如您所看到的,在同一时间内有很多工作要做;因此,当计时器滴答作响时,程序在几秒钟内没有响应。 我需要一个解决方案来解决这个问题,并告诉程序在完成前一项工作或类似的工作后再做这项工作


谢谢。

研究一下如何使用BackGroundWorker…您使用的是什么框架?-它在4.0下,您可以使用
BackGroundWorker
异步委托
,普通的
线程
…即使在那时也有很多选择