convert visual basic 6.0 to visual basic 2010
-
hy. i have the code from visual basic 6.0 i want change and convert from visual basic 6.0 to visual basic 2010. this is my code. i don't understand using syntax get and put in visual basic. can you help me and explain to me about my code. Private Sub Command3_Click() Dim data As String Dim x As Long Dim y As Long Dim z As Long Dim pjg As Long Dim ext As String Dim encpjg As String encpjg = FileLen(Text2.Text) ext = Mid(StrReverse(Text2.Text), 1, 4) ext = StrReverse(ext) pjg = FileLen(Text1.Text) FileCopy Text2.Text, Text2.Text & "_STEGO" & ext x = FileLen(Text1.Text) Mod 10000 y = FileLen(Text1.Text) - x Open Text1.Text For Binary Access Read As #1 Open Text2.Text & "_STEGO" & ext For Binary Access Write As #2 Put #2, FileLen(Text2.Text) + 1, "" If pjg >= 10000 Then For z = 1 To y Step 10000 data = Space$(10000) Get #1, z, data Put #2, , encrypt(data, Text5.Text) Next y = x data = Space$(y) Get #1, , data Put #2, , encrypt(data, Text5.Text) Put #2, , "|" & encrypt(encpjg, Text5.Text) Else data = Space$(pjg) Get #1, 1, data Put #2, , encrypt(data, Text5.Text) Put #2, , "|" & encrypt(encpjg, Text5.Text) End If Close #2 Close #1 MsgBox "done!!" & vbCrLf & "file stego in " & Text2.Text & "_STEGO" & ext, vbOKOnly, "stego" End Sub
-
hy. i have the code from visual basic 6.0 i want change and convert from visual basic 6.0 to visual basic 2010. this is my code. i don't understand using syntax get and put in visual basic. can you help me and explain to me about my code. Private Sub Command3_Click() Dim data As String Dim x As Long Dim y As Long Dim z As Long Dim pjg As Long Dim ext As String Dim encpjg As String encpjg = FileLen(Text2.Text) ext = Mid(StrReverse(Text2.Text), 1, 4) ext = StrReverse(ext) pjg = FileLen(Text1.Text) FileCopy Text2.Text, Text2.Text & "_STEGO" & ext x = FileLen(Text1.Text) Mod 10000 y = FileLen(Text1.Text) - x Open Text1.Text For Binary Access Read As #1 Open Text2.Text & "_STEGO" & ext For Binary Access Write As #2 Put #2, FileLen(Text2.Text) + 1, "" If pjg >= 10000 Then For z = 1 To y Step 10000 data = Space$(10000) Get #1, z, data Put #2, , encrypt(data, Text5.Text) Next y = x data = Space$(y) Get #1, , data Put #2, , encrypt(data, Text5.Text) Put #2, , "|" & encrypt(encpjg, Text5.Text) Else data = Space$(pjg) Get #1, 1, data Put #2, , encrypt(data, Text5.Text) Put #2, , "|" & encrypt(encpjg, Text5.Text) End If Close #2 Close #1 MsgBox "done!!" & vbCrLf & "file stego in " & Text2.Text & "_STEGO" & ext, vbOKOnly, "stego" End Sub
get and put are used for reading and writing binary files in vb6, find out more: http://www.vb6.us/tutorials/reading-and-writing-binary-files-visual-basic[^]
-
get and put are used for reading and writing binary files in vb6, find out more: http://www.vb6.us/tutorials/reading-and-writing-binary-files-visual-basic[^]
can you explain to me about using syntax put and get in visual basic 2010.
-
can you explain to me about using syntax put and get in visual basic 2010.
put and get in vb6 had been replaced with fileput and fileget. You may consult MSDN msdn.microsoft.com[^]
-
hy. i have the code from visual basic 6.0 i want change and convert from visual basic 6.0 to visual basic 2010. this is my code. i don't understand using syntax get and put in visual basic. can you help me and explain to me about my code. Private Sub Command3_Click() Dim data As String Dim x As Long Dim y As Long Dim z As Long Dim pjg As Long Dim ext As String Dim encpjg As String encpjg = FileLen(Text2.Text) ext = Mid(StrReverse(Text2.Text), 1, 4) ext = StrReverse(ext) pjg = FileLen(Text1.Text) FileCopy Text2.Text, Text2.Text & "_STEGO" & ext x = FileLen(Text1.Text) Mod 10000 y = FileLen(Text1.Text) - x Open Text1.Text For Binary Access Read As #1 Open Text2.Text & "_STEGO" & ext For Binary Access Write As #2 Put #2, FileLen(Text2.Text) + 1, "" If pjg >= 10000 Then For z = 1 To y Step 10000 data = Space$(10000) Get #1, z, data Put #2, , encrypt(data, Text5.Text) Next y = x data = Space$(y) Get #1, , data Put #2, , encrypt(data, Text5.Text) Put #2, , "|" & encrypt(encpjg, Text5.Text) Else data = Space$(pjg) Get #1, 1, data Put #2, , encrypt(data, Text5.Text) Put #2, , "|" & encrypt(encpjg, Text5.Text) End If Close #2 Close #1 MsgBox "done!!" & vbCrLf & "file stego in " & Text2.Text & "_STEGO" & ext, vbOKOnly, "stego" End Sub
This link may help you http://www.vb-helper.com/howto_2005_read_write_classic.html[^]
Private Const NUM_VALUES As Integer = 10
Const INTEGER_SIZE As Integer = 4Private m_TextBoxes() As TextBox
' Load saved values.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal _
e As System.EventArgs) Handles MyBase.Load
m_TextBoxes = New TextBox() {TextBox1, TextBox2, _
TextBox3, TextBox4, TextBox5, TextBox6, TextBox7, _
TextBox8, TextBox9, TextBox10}' Get the file name. Dim file\_name As String = GetFileName() ' See if the file exists. If System.IO.File.Exists(file\_name) Then ' Open the file. Dim file\_num As Integer = FreeFile() FileOpen(file\_num, file\_name, \_ OpenMode.Binary, OpenAccess.Read, \_ OpenShare.Shared, INTEGER\_SIZE) ' Read the array. Dim integers(NUM\_VALUES - 1) As Integer FileGet(file\_num, integers) ' Close the file. FileClose(file\_num) ' Display values. For i As Integer = 0 To NUM\_VALUES - 1 m\_TextBoxes(i).Text = integers(i).ToString() Next i End If
End Sub
' Save the current values.
Private Sub Form1_FormClosing(ByVal sender As Object, ByVal _
e As System.Windows.Forms.FormClosingEventArgs) Handles _
Me.FormClosing
' Get the file name.
Dim file_name As String = GetFileName()' Create the file. Dim file\_num As Integer = FreeFile() FileOpen(file\_num, file\_name, \_ OpenMode.Binary, OpenAccess.Write, \_ OpenShare.Shared, INTEGER\_SIZE) ' Write the array. Dim integers(NUM\_VALUES - 1) As Integer For i As Integer = 0 To NUM\_VALUES - 1 integers(i) = Val(m\_TextBoxes(i).Text) Next i FilePut(file\_num, integers) ' Close the file. FileClose(file\_num)
End Sub
-
hy. i have the code from visual basic 6.0 i want change and convert from visual basic 6.0 to visual basic 2010. this is my code. i don't understand using syntax get and put in visual basic. can you help me and explain to me about my code. Private Sub Command3_Click() Dim data As String Dim x As Long Dim y As Long Dim z As Long Dim pjg As Long Dim ext As String Dim encpjg As String encpjg = FileLen(Text2.Text) ext = Mid(StrReverse(Text2.Text), 1, 4) ext = StrReverse(ext) pjg = FileLen(Text1.Text) FileCopy Text2.Text, Text2.Text & "_STEGO" & ext x = FileLen(Text1.Text) Mod 10000 y = FileLen(Text1.Text) - x Open Text1.Text For Binary Access Read As #1 Open Text2.Text & "_STEGO" & ext For Binary Access Write As #2 Put #2, FileLen(Text2.Text) + 1, "" If pjg >= 10000 Then For z = 1 To y Step 10000 data = Space$(10000) Get #1, z, data Put #2, , encrypt(data, Text5.Text) Next y = x data = Space$(y) Get #1, , data Put #2, , encrypt(data, Text5.Text) Put #2, , "|" & encrypt(encpjg, Text5.Text) Else data = Space$(pjg) Get #1, 1, data Put #2, , encrypt(data, Text5.Text) Put #2, , "|" & encrypt(encpjg, Text5.Text) End If Close #2 Close #1 MsgBox "done!!" & vbCrLf & "file stego in " & Text2.Text & "_STEGO" & ext, vbOKOnly, "stego" End Sub
If you have access to Visual Studio 2005 you can do it in two steps. VS2005 has a converter from VB6 to VB2005, and 2010 has a converter from 2005. Whilst that may be helpful if it is available to you as an option you still need to understand VB.NET as the converter will leave many things that have to be tweaked by hand.