Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. convert visual basic 6.0 to visual basic 2010

convert visual basic 6.0 to visual basic 2010

Scheduled Pinned Locked Moved Visual Basic
help
6 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kikyamelia
    wrote on last edited by
    #1

    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

    P E T 3 Replies Last reply
    0
    • K kikyamelia

      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

      P Offline
      P Offline
      Peter Leow
      wrote on last edited by
      #2

      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[^]

      K 1 Reply Last reply
      0
      • P Peter Leow

        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[^]

        K Offline
        K Offline
        kikyamelia
        wrote on last edited by
        #3

        can you explain to me about using syntax put and get in visual basic 2010.

        P 1 Reply Last reply
        0
        • K kikyamelia

          can you explain to me about using syntax put and get in visual basic 2010.

          P Offline
          P Offline
          Peter Leow
          wrote on last edited by
          #4

          put and get in vb6 had been replaced with fileput and fileget. You may consult MSDN msdn.microsoft.com[^]

          1 Reply Last reply
          0
          • K kikyamelia

            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

            E Offline
            E Offline
            Eldar Zeynalov
            wrote on last edited by
            #5

            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 = 4

            Private 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

            1 Reply Last reply
            0
            • K kikyamelia

              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

              T Offline
              T Offline
              TheComputerMan
              wrote on last edited by
              #6

              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.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups