c# - how to set progressbar while downloading file from ftp -
following code used download exe file drivehq
private sub button1_click(byval sender system.object, byval e system.eventargs) handles button1.click try dim strftppath, strdestpath string cursor.current = cursors.waitcursor 'strftppath url of latest upd located 'strdestpath system path dwonload upd ftp strftppath = "ftp://myusrnam:mypwd@ftp.drivehq.com/rstari9kremcos/rstari9.exe" strdestpath = "d:\rstari9\gds\rstari9.exe" my.computer.network.downloadfile(strftppath, strdestpath) cursor.current = cursors.arrow button1.enabled = false msgbox("latest updation downloaded 'd:\rstari9\gds\rstari9.exe'", msgboxstyle.information, "rstari9 - download success") catch ex exception msgbox(ex.message, msgboxstyle.information, "update downloading aborted...") end try end sub
and this ui download, want add progressbar in it
code : vb.net
my.computer.network.downloadfile has parameter called showui
, can set true display progress of operation. can change code in way:
my.computer.network.downloadfile(strftppath, strdestpath, "", "", true, 100000, false)
unfortunately, my.computer.network.downloadfile hasn't way download file asynchronously, have use else if want develop own ui.
Comments
Post a Comment