我做了一个自更新的小程序,需要更新两个文件,在循环中更新文件,我在循环中用label显示正在下载的文件,不知道为什么label标签不能显示,只有下载完了才显示最后一个文件?我该怎么解决这个问题?谢谢

解决方案 »

  1.   

    程序如下:        For I = 0 To FileZs - 1
                Label1.Text = "正在下载第" & (I + 1).ToString.Trim & "/" & FileZs.ToString.Trim & "个文件"
                If File.Exists(MainPath + "\" + Sfile(I).Trim) Then
                    File.Delete(MainPath + "\" + Sfile(I).Trim)
                End If
                If DownLoad(MyHttp + "/GameUpdate/" + Sfile(I).Trim, MainPath + "\" + Sfile(I).Trim) = False Then
                    Label1.Text = "下载文件错误,请稍候再试!"
                    Return
                End If
            Nextlabel也不用刷新呀
      

  2.   

     在每次循环开始你加上一句 label1.refresh  试试
      

  3.   

            For I = 0 To FileZs - 1 
                Label1.Text = "正在下载第" & (I + 1).ToString.Trim & "/" & FileZs.ToString.Trim & "个文件"             '' 加上下面的任意一条语句都可以
                  Label1.Refresh
                Dovents            If File.Exists(MainPath + "\" + Sfile(I).Trim) Then 
                    File.Delete(MainPath + "\" + Sfile(I).Trim) 
                End If 
                If DownLoad(MyHttp + "/GameUpdate/" + Sfile(I).Trim, MainPath + "\" + Sfile(I).Trim) = False Then 
                    Label1.Text = "下载文件错误,请稍候再试!" 
                    Return 
                End If 
            Next 
      

  4.   

    谢谢
    加入Label1.Refresh即可
    给分