打开浏览器,截屏,关闭,i ++,重复

时间:2017-03-13 13:33:19

标签: .net vb.net visual-studio

有没有人帮我解决我的问题,因为我没有足够的知识来弄清楚如何使程序运作。 所以我有一个简单的表单(vb.net表单),1个按钮和1个numberupdown。 该计划应该做下一件事。在我在该numberupdown框中插入一个数字并点击开始后,程序必须打开浏览器窗口,其下一个地址为" site.tld /" &安培; numberupdown.value。因此,如果我插入12345,则必须使用下一页打开浏览器:site。 TLD / 12345。完成加载后,在一段特定时间后,程序必须截取屏幕截图并将其保存在以numberupdown.value命名的特定文件夹(无论在哪里)。 保存屏幕截图后,浏览器窗口(或整个程序)必须关闭。然后用1增加numberupdown.value,并重复。

我有足够的知识来弄清楚如何打开浏览器并转到特定的URL地址,我还发现了如何杀死进程。但无法弄清楚如何截取屏幕截图以及如何使整个过程自动化。

对不起我的英语和我的语法错误(如果有的话)。提前谢谢!

Public Class Form1

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    Timer1.Start()
End Sub

Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
    Dim sitenr As String
    sitenr = NumericUpDown1.Value
    ProgressBar1.Increment(+1)
    If ProgressBar1.Value = 1 Then
        Diagnostics.Process.Start("http://www . site . tld " & NumericUpDown1.Value)
    End If
    If ProgressBar1.Value = 50 Then
                   Dim pList() As System.Diagnostics.Process =
System.Diagnostics.Process.GetProcessesByName("notepad")
        For Each proc As System.Diagnostics.Process In pList

            proc.Kill()
        Next
    End If
    If ProgressBar1.Value = 60 Then
        Timer1.Stop()
        NumericUpDown1.Value = +1
        ProgressBar1.Value = 0
        Timer1.Start()
    End If

End Sub

结束班

我重新尝试了一下,刚开始再次考虑一个进度条会帮助我做更多的事情,但是无法计算如何在progressbar1.value达到60之后重启过程。我会搜索更多并找到这项工作的方式,我只需要一些截图帮助..

0 个答案:

没有答案