|
-
Jan 7th, 2004, 02:49 AM
#1
Thread Starter
Addicted Member
Backup Funktion
I’m trying to do a simple backup to a Floppy but I don’t know how to code it to where it loops until it has successfully written my file!
I would appreciate it very much if someone could show me!
Thanks!!!
Here is what I have!
VB Code:
Dim result As MsgBoxResult
result = MessageBox.Show("Please Insert a Floppy Disk into Drive A:\", "Insert Floppy", MessageBoxButtons.OKCancel, MessageBoxIcon.Information)
If result = MsgBoxResult.OK Then
Try
System.IO.File.Delete("A:\MyFile")
System.IO.File.Copy("C:\Program Files\My Program\My File", "A:\My File")
Catch ex As Exception
MessageBox.Show(ex.Message, " An Error has Occurred! ")
End Try
ElseIf result = MsgBoxResult.Cancel Then
Exit Sub
End If
Last edited by Rally2000; Jan 7th, 2004 at 02:52 AM.
Code:
Dim R1 As Fast
Dim Kawasaki As crap
Dim rash As necessary
If Kawasaki onRoad = True Then
R1.runoverKawasaki
Kawasaki = rash
-
Jan 7th, 2004, 04:21 PM
#2
Hi.
One way of doing it could be to use streams instead of the copy method.
If you open and read the original file as a stream, you can read the entire file into a byte array.
Then you can open a new stream on the floppy, where you can write the same byte array, one byte at a time. this way you can even have a progressbar showing you how far you got.
If you want to speed it up, you should probably write 1024 bytes at a time, but that's up to you, how many you want.
Hope this is help to you. If not, please ignore..
I wish I could think of something witty to put in my sig...
...Currently using VS2013...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|