本文介绍了使用vb.net中的vbtimer每10分钟下载一个文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
每10分钟在vb.net或jquery或javascript中使用vbtimer下载一个文件夹
Download a folder every 10 mins using a vbtimer in vb.net or jquery or javascript
推荐答案
Private Sub Timer2_Tick(sender As Object, e As EventArgs) Handles magnetimer.Tick
'set timer to 60000 = one minute
Dim myWebClient As New System.Net.WebClient
Static iCount As Integer
If iCount = 10 Then
iCount = 0
Try
myWebClient.DownloadFile(TxtUrl2.Text, txtDownload.Text & MagnetoFilcount.Text ".gif") ' Code that causes error here
myWebClient.Dispose()
Catch
' Ignore error
End Try
Filecount.Text = Filecount.Text + 1 'filecount
CountDownTxt.Text = Math.Abs(iCount - 60) 'minutes timer
Else
CountDownTxt.Text = Math.Abs(iCount - 60) 'minutes timer
iCount = iCount + 1 'timer goes off every minute '60000 millseconds
End If
End Sub
这篇关于使用vb.net中的vbtimer每10分钟下载一个文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!