Dirk Diggler |
19-03-2007 07:55 563562 |
Вот такую хрень сделал. Медленно, но другой нет
Код:
$filename = "now" & @MIN & @SEC & "temp"
$fil = FileOpen( $filename, 2)
$kb = ""
For $i = 1 to 1024 Step 1
$kb &= "1"
Next
$Mb = ""
For $i = 1 to 1024 Step 1
$Mb &= $kb & @CRLF
Next
#region --- GuiBuilder code Start ---
; Script generated by AutoBuilder 0.6 Prototype
#include <GuiConstants.au3>
GuiCreate("MyGUI", 147, 45,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))
$btStop = GuiCtrlCreateButton("Stop writing!", 10, 10, 130, 30)
GuiSetState()
$volume = 0
Do
$msg = GuiGetMsg()
Select
Case ($msg = $GUI_EVENT_CLOSE) or ($msg = $btStop)
ExitLoop
Case Else
;;;
EndSelect
$err= FileWriteLine( $fil, $Mb)
$volume += 1
Until ($err <> 1)
FileClose($fil)
GUIDelete()
GuiCreate("MyGUI", 147, 45,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))
$btStop = GuiCtrlCreateButton("verifyin'...", 10, 10, 130, 30)
GuiSetState()
$fil = FileOpen( $filename,0 )
$verifyfailed = 0
$verified = 0
While 1
$msg = GuiGetMsg()
if ($msg = $GUI_EVENT_CLOSE) or ($msg = $btStop) Then ExitLoop
for $k = 1 to 1024
$line = FileReadLine($fil)
If @error = -1 Then ExitLoop
if $line <> $kb then $verifyfailed = 1
Next
If @error = -1 Then ExitLoop
$verified += 1
Wend
GUIDelete()
MsgBox(0,"Verify result", "Volume: " & ($volume) & "Mb" & @CRLF & "Verified:" & $verified & "Mb" & @CRLF & "Verify failed: " & ($verifyfailed = 1))
FileClose($fil)
FileDelete($filename)
|