我正在尝试制作一个视图机器人。仅供娱乐/个人使用。问题是我正在尝试使它一次只能打开 20 个窗口。由于某种原因它不会工作。我还希望它在关闭它生成的进程并进入循环之前等待 2000 毫秒。我有 co1unt 作为整数。有人帮忙吗?
Dim Co1unt As Integer = 0
Public Sub Refreshlist()
Dim p As Process, co1unt As Integer, MyProgram As String = "iexplore"
For Each p In Process.GetProcesses
If p.ProcessName = MyProgram Then
co1unt = co1unt + 1
TextBox1.Text = co1unt
End If
Next
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Refreshlist()
Do
Refreshlist()
If Co1unt < 20 Then
Dim webAddress As String = ""
Dim p1 As Process = Process.Start(webAddress)
System.Threading.Thread.Sleep(2000)
p1.Kill()
End If
Loop
End Sub