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. Generating character combinations - help!

Generating character combinations - help!

Scheduled Pinned Locked Moved Visual Basic
helptutorialquestion
5 Posts 3 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.
  • A Offline
    A Offline
    Anonymous
    wrote on last edited by
    #1

    How would I go about writing something that would generate all possible character combinations for a given length and properties, such as uppercase/lowercase/both, numbers/letters/both, etc? For example, if you put in say, 2 digits, it will generate: aa aA ab aB ac aC ... Aa AA Ab AB Ac AC ... etc... Has anyone done this, and if not, how is the best way to do this?

    C 1 Reply Last reply
    0
    • A Anonymous

      How would I go about writing something that would generate all possible character combinations for a given length and properties, such as uppercase/lowercase/both, numbers/letters/both, etc? For example, if you put in say, 2 digits, it will generate: aa aA ab aB ac aC ... Aa AA Ab AB Ac AC ... etc... Has anyone done this, and if not, how is the best way to do this?

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Nested loops, or recursion would be the two obvious answers. Why do you need to do this ? Are you trying to crack passwords ? Christian Graus - Microsoft MVP - C++

      A B 2 Replies Last reply
      0
      • C Christian Graus

        Nested loops, or recursion would be the two obvious answers. Why do you need to do this ? Are you trying to crack passwords ? Christian Graus - Microsoft MVP - C++

        A Offline
        A Offline
        Anonymous
        wrote on last edited by
        #3

        Hmmm, how would I go about this? Is there an example for nested loops somewhere?

        C 1 Reply Last reply
        0
        • A Anonymous

          Hmmm, how would I go about this? Is there an example for nested loops somewhere?

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          A nested loop is just something like this for (int i=0;i

          1 Reply Last reply
          0
          • C Christian Graus

            Nested loops, or recursion would be the two obvious answers. Why do you need to do this ? Are you trying to crack passwords ? Christian Graus - Microsoft MVP - C++

            B Offline
            B Offline
            Brett Peirce
            wrote on last edited by
            #5

            yes indeed, why would you want to do this - maybe it's something as innocent as a class assignment, but maybe not... if it is innocent though, an example in VB like the one above - just in case you are sitting there scratching your head - is as follows:   Dim x, y As Integer 'declare x and y - your counting variables   For x = 1 To 20     'anything inside this loop, including the following loop, will be repeated 20 times     For y = 1 To 30       'this loop will repeat anything inside it 30 times     Next   Next Of course you're not limited to "For" loops; you could use any kind of loop. And if you're still sitting there scratching your head, then you need to learn a little more about programming in general - buy a book or take a class. btw Good luck with those passwords - I mean that assignment. sincerely, Brett Peirce - PolerBear To err is human; To forgive: divine. -- modified at 0:16 Thursday 20th October, 2005

            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