pls convert it tp vb.net code
Private WithEvents Huffman As clsHuffman
Dim sourceFile As String
Private Sub CMD_RESTORE_Click()
If Len(Label1(1).Caption) = 0 Then
MsgBox "Select Backup File Path and then Click Restore Button...", vbInformation, "Select Path ..."
Exit Sub
End If
ProgressBar1.Visible = True
lblStat.Visible = True
Call Huffman.DecodeFile(sourceFile, App.Path & "\dbbackups\payroll.mdb")
ProgressBar1.Value = 0
Unload Me
End Sub
Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub Dir1_Change()
Label1(1).Caption = ""
On Error GoTo A1:
File1.Path = Dir1.Path
File1.Pattern = "*.bk"
Exit Sub
A1:
MsgBox "Folder Can not be Accessed ...", vbInformation, "Drive not Accessed ..."
Drive1.Drive = "c:"
End Sub
Private Sub Drive1_Change()
Label1(1).Caption = ""
On Error GoTo A1:
Dir1.Path = Drive1.Drive
Exit Sub
A1:
MsgBox "Drive Can not be Accessed ...", vbInformation, "Drive not Accessed ..."
Drive1.Drive = "c:"
End Sub
Private Sub File1_Click()
If Right(File1.Path, 1) = "\" Then
sourceFile = File1.Path & File1.FileName
Else
sourceFile = File1.Path & "\" & File1.FileName
End If
Label1(1).Caption = sourceFile
End Sub
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 27 Then
If ProgressBar1.Value = 0 Or ProgressBar1.Value Then
Unload Me
End If
End If
End Sub
Private Sub Form_Load()
Label1(1).Caption = ""
lblStat.Visible = False
ProgressBar1.Visible = False
Set Huffman = New clsHuffman
Drive1.Drive = "c:"
Dir1.Path = App.Path & "\dbBackUps"
File1.Path = Dir1.Path
File1.Pattern = "*.bk"
End Sub
Private Sub Huffman_Progress(Procent As Integer)
lblStat.Caption = "Uncompressing Database"
ProgressBar1.Value = Procent
If ProgressBar1.Value = 100 Then
lblStat.Caption = "Restoring Uncompressed File ..."
Call MsgBox("Backup DBASE is successfully restored.", vbInformation, "Payroll System")
End If
DoEvents
End Sub
This post has been edited by pupubear: 22 August 2009 - 03:49 AM

New Topic/Question
Reply




MultiQuote





|