Страница: 1 |
|
Вопрос: Progressbar Need help!
|
Добавлено: 28.08.06 20:52
|
|
Автор вопроса: Monk
|
Необходимо для замутить в программе разбивалке файла на части - progressbar чтоб был виден прогресс. Я с баром никогда не работал так что объясните как это сделать. Мож какие мануалы есть. Вот код дробилки:
Private Sub cmdgo_Click()
Dim recPos, lenMod, lenDiv As Long
Dim readF As Byte
Dim c, lenOfFile, AmountOfBytes As Long
Dim fileName, folderName, fn As String
Dim mass() As Byte
Dim Counta
fn = "001"
recPos = 1
fileName = Text2.Text
lenOfFile = FileLen(fileName)
AmountOfBytes = Val(txtKusok.Text)
folderName = ExtractFolderName(fileName)
If optSubDir Then
folderName = folderName & "\" & txtPapka & "\"
Dim fEx
fEx = Dir(folderName, vbDirectory)
If fEx = "" Then
MkDir folderName
End If
Else
folderName = folderName & "\"
End If
Open folderName & "Infa.inf" For Output As #4
Print #4, ExtractFileName(fileName)
Close #4
If lenOfFile <= Val(txtKusok.Text) Then
MsgBox "×àñòü äîëæíà áûòü ìåíüøå ÷åì ôàéë. Èçìåíèòå ðàçìåð ÷àñòè â íàñòðîéêàõ", vbCritical, "Îøèáî÷êà âûøëà..."
Exit Sub
End If
lenDiv = lenOfFile \ AmountOfBytes
If lenDiv > 999 Then
MsgBox "ÌÀÊÑÈÌÓÌ 999 ×ÀÑÒÅÉ!", vbCritical, "Îøèáêà!!!"
Exit Sub
End If
lenMod = lenOfFile Mod AmountOfBytes
If lenMod = 0 Then
Open fileName For Binary As #1
Open folderName & fn & ".DMS" For Binary As #3
ReDim mass(AmountOfBytes - 1)
c = 1
Do While c < lenOfFile - 1
Get #1, c, mass
Put #3, 1, mass
c = c + AmountOfBytes
Close #3
If c < lenOfFile - 1 Then
IncFn fn
Open folderName & fn & ".DMS" For Binary As #3
End If
Loop
Close #3
Close #1
Else
Open fileName For Binary As #1
Open folderName & fn & ".DMS" For Binary As #3
ReDim mass(AmountOfBytes - 1)
c = 1
Do While c < (lenDiv * AmountOfBytes) - 1
Get #1, c, mass
Put #3, 1, mass
c = c + AmountOfBytes
Close #3
If c < (lenDiv * AmountOfBytes) - 1 Then
IncFn fn
Open folderName & fn & ".DMS" For Binary As #3
End If
Loop
Close #3
IncFn fn
recPos = 1
Open folderName & fn & ".DMS" For Binary As #3
ReDim mass(lenMod - 1)
Get #1, (lenDiv * AmountOfBytes) + 1, mass
Put #3, 1, mass
Close #3
Close #1
End If
MsgBox "Ãîòîâî! Âûáðàííûé ôàéë " & fileName & " áûë ðàçáèò íà " & Val(fn) & " ÷àñòè(åé)!", vbInformation, "Óðà!!!!"
End Sub
Помогите Плиз!!!
Ответить
|
Страница: 1 |
Поиск по форуму