6 Replies - 1054 Views - Last Post: 22 August 2009 - 07:26 AM Rate Topic: -----

#1 pupubear  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 10-April 08

Help me pls. convert this code from vb 6 to vb.net

Post icon  Posted 22 August 2009 - 02:44 AM

pls help. here is the code
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


Is This A Good Question/Topic? 0
  • +

Replies To: Help me pls. convert this code from vb 6 to vb.net

#2 firebolt  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 92
  • View blog
  • Posts: 5,561
  • Joined: 20-February 09

Re: Help me pls. convert this code from vb 6 to vb.net

Posted 22 August 2009 - 03:23 AM

Where did you get this code from? Do you understand what it does?
Was This Post Helpful? 0
  • +
  • -

#3 pupubear  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 10-April 08

Re: Help me pls. convert this code from vb 6 to vb.net

Posted 22 August 2009 - 03:26 AM

View Postfirebolt, on 22 Aug, 2009 - 02:23 AM, said:

Where did you get this code from? Do you understand what it does?

yes it restore database from the system.
Was This Post Helpful? 0
  • +
  • -

#4 PDUNZ  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 43
  • View blog
  • Posts: 376
  • Joined: 17-July 09

Re: Help me pls. convert this code from vb 6 to vb.net

Posted 22 August 2009 - 03:46 AM

Please :code:
Was This Post Helpful? 0
  • +
  • -

#5 firebolt  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 92
  • View blog
  • Posts: 5,561
  • Joined: 20-February 09

Re: Help me pls. convert this code from vb 6 to vb.net

Posted 22 August 2009 - 04:01 AM

View Postpupubear, on 22 Aug, 2009 - 08:26 PM, said:

View Postfirebolt, on 22 Aug, 2009 - 02:23 AM, said:

Where did you get this code from? Do you understand what it does?

yes it restore database from the system.


You haven't answered my first question: Where did you get this code from?

Quote

yes it restore database from the system.

So if you know what it is, why not just code it yourself?
Was This Post Helpful? 0
  • +
  • -

#6 pupubear  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 10-April 08

Re: Help me pls. convert this code from vb 6 to vb.net

Posted 22 August 2009 - 06:32 AM

View Postfirebolt, on 22 Aug, 2009 - 03:01 AM, said:

View Postpupubear, on 22 Aug, 2009 - 08:26 PM, said:

View Postfirebolt, on 22 Aug, 2009 - 02:23 AM, said:

Where did you get this code from? Do you understand what it does?

yes it restore database from the system.


You haven't answered my first question: Where did you get this code from?

Quote

yes it restore database from the system.

So if you know what it is, why not just code it yourself?

if all people here are just like you. i never post here again.
:angry:
Was This Post Helpful? 0
  • +
  • -

#7 firebolt  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 92
  • View blog
  • Posts: 5,561
  • Joined: 20-February 09

Re: Help me pls. convert this code from vb 6 to vb.net

Posted 22 August 2009 - 07:26 AM

Here's a start:
VB6
Private Sub CMD_RESTORE_Click()

VB.NET
Private Sub CMD_RESTORE_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CMD_RESTORE.Click


For message boxes:
MessageBox.Show("Your Message Here")



Closing a form:
Me.Close



Progress bar:
Me.progressBar1 = New System.WinForms.ProgressBar()


You really need to understand the syntax. There's not much use in us just giving you a converted code. You will never learn.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1