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
  1. Home
  2. General Programming
  3. Visual Basic
  4. AAAHHH conversion from vb6 to vb.net HELP PLEASE

AAAHHH conversion from vb6 to vb.net HELP PLEASE

Scheduled Pinned Locked Moved Visual Basic
csharphelp
6 Posts 5 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.
  • O Offline
    O Offline
    offroaderdan
    wrote on last edited by
    #1

    Hi i have a program near enough already made in vb.net but want to add a serail key program. I made it last year but don't know some of the techniques in vb.net here is the code used Dim xSlash As String Dim xFileNbr As Integer Dim xFileName As String Private Sub Command1_Click() Dim hole As String xSlash = IIf(Right$(App.Path, 1) = "\", "", "\") xFileName = App.Path & xSlash & "cookies.txt" xNbr = FreeFile + Rnd Open xFileName For Input As #xNbr Do Until EOF(xNbr) Input #xNbr, hole If Text1.Text = hole Then Startnot.Value = vbUnchecked Form3.Visible = True Me.Visible = False Else Label1.Caption = ("Wrong CD Key") 'B36-678-A863-7CG8F' - End If Loop Close End Sub Private Sub Form_Load() xSlash = IIf(Right$(App.Path, 1) = "\", "", "\") xFileName = App.Path & xSlash & "cookies.txt" SetAttr xFileName, vbHidden Dim Dontshow As Long Dontshow = GetSetting(App.EXEName, "Options", "Dont Show Me", 1) If Dontshow = 1 Then Unload Me Form3.Show Exit Sub End If Startnot.Value = vbChecked End Sub Private Sub Startnot_Click() SaveSetting App.EXEName, "Options", "Dont Show Me", Startnot.Value End Sub Public Function backup() Dim XfileW As String xSlash = IIf(Right$(App.Path, 1) = "\", "", "\") XfileW = App.Path & xSlash & "checkme.txt" xNbr = FreeFile Open XfileW For Output As #xNbr If Text1.Text = hole Then Print #xNbr, "1" Close #xNo End Function if anybody could translate it, that would be very helpful as i have laoready pulled out a lot of hair!!! Many thanks Dan

    J S 2 Replies Last reply
    0
    • O offroaderdan

      Hi i have a program near enough already made in vb.net but want to add a serail key program. I made it last year but don't know some of the techniques in vb.net here is the code used Dim xSlash As String Dim xFileNbr As Integer Dim xFileName As String Private Sub Command1_Click() Dim hole As String xSlash = IIf(Right$(App.Path, 1) = "\", "", "\") xFileName = App.Path & xSlash & "cookies.txt" xNbr = FreeFile + Rnd Open xFileName For Input As #xNbr Do Until EOF(xNbr) Input #xNbr, hole If Text1.Text = hole Then Startnot.Value = vbUnchecked Form3.Visible = True Me.Visible = False Else Label1.Caption = ("Wrong CD Key") 'B36-678-A863-7CG8F' - End If Loop Close End Sub Private Sub Form_Load() xSlash = IIf(Right$(App.Path, 1) = "\", "", "\") xFileName = App.Path & xSlash & "cookies.txt" SetAttr xFileName, vbHidden Dim Dontshow As Long Dontshow = GetSetting(App.EXEName, "Options", "Dont Show Me", 1) If Dontshow = 1 Then Unload Me Form3.Show Exit Sub End If Startnot.Value = vbChecked End Sub Private Sub Startnot_Click() SaveSetting App.EXEName, "Options", "Dont Show Me", Startnot.Value End Sub Public Function backup() Dim XfileW As String xSlash = IIf(Right$(App.Path, 1) = "\", "", "\") XfileW = App.Path & xSlash & "checkme.txt" xNbr = FreeFile Open XfileW For Output As #xNbr If Text1.Text = hole Then Print #xNbr, "1" Close #xNo End Function if anybody could translate it, that would be very helpful as i have laoready pulled out a lot of hair!!! Many thanks Dan

      J Offline
      J Offline
      justastupidgurl
      wrote on last edited by
      #2

      first indent your code and repost it :)

      JustAStupidGurl

      1 Reply Last reply
      0
      • O offroaderdan

        Hi i have a program near enough already made in vb.net but want to add a serail key program. I made it last year but don't know some of the techniques in vb.net here is the code used Dim xSlash As String Dim xFileNbr As Integer Dim xFileName As String Private Sub Command1_Click() Dim hole As String xSlash = IIf(Right$(App.Path, 1) = "\", "", "\") xFileName = App.Path & xSlash & "cookies.txt" xNbr = FreeFile + Rnd Open xFileName For Input As #xNbr Do Until EOF(xNbr) Input #xNbr, hole If Text1.Text = hole Then Startnot.Value = vbUnchecked Form3.Visible = True Me.Visible = False Else Label1.Caption = ("Wrong CD Key") 'B36-678-A863-7CG8F' - End If Loop Close End Sub Private Sub Form_Load() xSlash = IIf(Right$(App.Path, 1) = "\", "", "\") xFileName = App.Path & xSlash & "cookies.txt" SetAttr xFileName, vbHidden Dim Dontshow As Long Dontshow = GetSetting(App.EXEName, "Options", "Dont Show Me", 1) If Dontshow = 1 Then Unload Me Form3.Show Exit Sub End If Startnot.Value = vbChecked End Sub Private Sub Startnot_Click() SaveSetting App.EXEName, "Options", "Dont Show Me", Startnot.Value End Sub Public Function backup() Dim XfileW As String xSlash = IIf(Right$(App.Path, 1) = "\", "", "\") XfileW = App.Path & xSlash & "checkme.txt" xNbr = FreeFile Open XfileW For Output As #xNbr If Text1.Text = hole Then Print #xNbr, "1" Close #xNo End Function if anybody could translate it, that would be very helpful as i have laoready pulled out a lot of hair!!! Many thanks Dan

        S Offline
        S Offline
        Steven J Jowett
        wrote on last edited by
        #3

        There is nothing overly complicated with your original code. I would strongly suggest you spend the time converting it to vb.net yourself, which will help with the vb.net learning curve. Remember Google is YOUR friend. You will need to use the System.IO.File namespace and some of the methods of String for example AStringVar.Length and AStringVar.SubString If you get really stuck, you can ask us help, but NOT to rewrite the whole code for you. Gook luck.

        Steve Jowett ------------------------- Real programmers don't comment their code. If it was hard to write, it should be hard to read.

        O 1 Reply Last reply
        0
        • S Steven J Jowett

          There is nothing overly complicated with your original code. I would strongly suggest you spend the time converting it to vb.net yourself, which will help with the vb.net learning curve. Remember Google is YOUR friend. You will need to use the System.IO.File namespace and some of the methods of String for example AStringVar.Length and AStringVar.SubString If you get really stuck, you can ask us help, but NOT to rewrite the whole code for you. Gook luck.

          Steve Jowett ------------------------- Real programmers don't comment their code. If it was hard to write, it should be hard to read.

          O Offline
          O Offline
          offroaderdan
          wrote on last edited by
          #4

          Thanks Steve for the reply. Umm i haven't really used System.Io.file as well as the other two. Can you explain how to use them in relation to my code??? And the reason for posting the cdoe is that people usually ask to see the code.

          H 1 Reply Last reply
          0
          • O offroaderdan

            Thanks Steve for the reply. Umm i haven't really used System.Io.file as well as the other two. Can you explain how to use them in relation to my code??? And the reason for posting the cdoe is that people usually ask to see the code.

            H Offline
            H Offline
            Henry Minute
            wrote on last edited by
            #5

            Posting the code was the right thing to do. Failing to put it inside 'pre' tags, so that the formatting and colourization were retained, was where you upset people. :) Honestly, it is so difficult to read unformatted code that I usually just skip over those posts, which might be a good thing. :-D

            Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

            L 1 Reply Last reply
            0
            • H Henry Minute

              Posting the code was the right thing to do. Failing to put it inside 'pre' tags, so that the formatting and colourization were retained, was where you upset people. :) Honestly, it is so difficult to read unformatted code that I usually just skip over those posts, which might be a good thing. :-D

              Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

              L Offline
              L Offline
              Luc Pattyn
              wrote on last edited by
              #6

              Hear hear. except for the usually :laugh:

              Luc Pattyn


              I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages


              Local announcement (Antwerp region): Lange Wapper? Neen!


              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