进度条 [英] Progressbar
问题描述
你好!没关系 ?我正在开发文件下载器.我是一个初学者,我想在下载中放置一个进度条.有人可以帮我提供示例代码吗?我的知识很少.如果可能的话,他们给我的细节和解释越多越好 对我来说.谢谢:D
Hello! It's ok ? I am developing file downloader. I'm a beginner, I want to put a progress bar in the download. Could someone help me with a sample code? My knowledge is little. If it were possible, the more details and explanations they gave me, the better it would be for me. Thank you: D
私有子Button3_Click(作为对象发送,作为EventArgs发送)处理Button3.Click
如果My.Computer.FileSystem.FileExists("C:download.jpg")= True,那么
MsgBox("Arquivojáexistente",vbCritical,"Download")
退出子
其他
如果My.Computer.FileSystem.FileExists("C:download.jpg")= False,则
My.Computer.Network.DownloadFile("http://tvcultura.com.br/upload/tvcultura/programas/programa-imagem-som.jpg","C:\ Users \ thiag \ Downloads \ arquivo.jpg" )
Shell("explorer C:\ download.jpg",vbHide)
如果结束
如果结束
结束
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
If My.Computer.FileSystem.FileExists("C:download.jpg") = True Then
MsgBox("Arquivo já existente", vbCritical, "Download")
Exit Sub
Else
If My.Computer.FileSystem.FileExists("C:download.jpg") = False Then
My.Computer.Network.DownloadFile("http://tvcultura.com.br/upload/tvcultura/programas/programa-imagem-som.jpg", "C:\Users\thiag\Downloads\arquivo.jpg")
Shell("explorer C:\download.jpg", vbHide)
End If
End If
End Sub
推荐答案
我正在开发文件下载器.我是一个初学者,我想在下载中放置一个进度条.有人可以帮我提供示例代码吗?
I am developing file downloader. I'm a beginner, I want to put a progress bar in the download. Could someone help me with a sample code?
如果您使用带有 showUI参数的DownloadFile重载,则用户将看到一个包含进度条的下载对话框.否则,无法将进度条与DownloadFile方法一起使用,因为
无法访问进度信息.
https://msdn.microsoft.com /en-us/library/ack30t8y(v=vs.90).aspx
If you use the overload of DownloadFile that takes the showUI argument, then the user will see a download dialog that includes a progress bar. Otherwise there is no way to use a progress bar with the DownloadFile method because you
do not have access to the progress information.
https://msdn.microsoft.com/en-us/library/ack30t8y(v=vs.90).aspx
否则,请使用此处所述的方法:
http://www.dreamincode.net/forums/topic/185093-download -file-asynchronously-with-progressbar/
Otherwise, use something like the method described here:
http://www.dreamincode.net/forums/topic/185093-download-file-asynchronously-with-progressbar/
这篇关于进度条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!