Dim Count As Integer
Dim cmd As New SQLCommand
cmd.CommandText = "Select Count(BH) From {SFMX}"
Count = cmd.ExecuteScalar
Dim pb As WinForm.ProgressBar = e.Form.Controls("ProgressBar1")
For i As Integer = 1 To Count
Count = i / 3
If i Mod 100 = 0 Then
pb.Value = i / Count * 100 ’改为Count后失去作用。
Application.DoEvents
End If
Next
Dim zip As New zipFile
Dim NewName As String
NewName = "门诊收费数据备份" & Date.Today.Year & "." & Date.Today.Month & "." & Date.Today.Day & ".Table"
Dim zFile As String = "D:\MZSF.Backup\"& NewName & ".zip"
If FileSys.FileExists(zfile) Then
zip.Open(zFile)
Else
zip.Create(zFile)
End If
zip.AddFile(ProjectFile, NewName)
zip.Close()
Syscmd.Project.Compact(False)
Syscmd.Project.Exit(True)
e.Form.Close()
问题1,加入Count后进度条失去作用。
问题2,如何将两段合并?第二段没有在进度中体现。
我的意思是备份完毕后,进度也完毕。
[此贴子已经被作者于2013-3-16 11:08:58编辑过]