5 Replies - 911 Views - Last Post: 28 September 2011 - 08:10 PM Rate Topic: -----

#1 Nemesis4895  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 46
  • Joined: 06-December 10

Create multi-dimension array from multiple text files

Posted 28 September 2011 - 05:03 PM

I'll explain what I'm working to eliminate the assumptions of a brute forcer. I'm working a Random SQL Data generator. What I need is a way to create a multi-dimensional array from multiple word lists, 1 dimension per word list. I have tried a few different things and nothing I've tried works. However, I have got it to work with a single word list and an array of 1. I figured there is a more efficient way of doing this than writing a massive block of select case and using multiple 1 dimensional arrays, this would end up very messy and inefficient it seems.

No this is not for homework, this is for personal learning use only.

I would post my code, but like I said, nothing I've tried comes close to working.

Is This A Good Question/Topic? 0
  • +

Replies To: Create multi-dimension array from multiple text files

#2 DimitriV  Icon User is offline

  • Don't try to save yourself… the circle is complete
  • member icon

Reputation: 544
  • View blog
  • Posts: 2,632
  • Joined: 24-July 11

Re: Create multi-dimension array from multiple text files

Posted 28 September 2011 - 05:06 PM

You should still post your code - you could have the right code just the wrong way round or with a couple of incorrect bits that we can help you iron out.
Was This Post Helpful? 0
  • +
  • -

#3 Nemesis4895  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 46
  • Joined: 06-December 10

Re: Create multi-dimension array from multiple text files

Posted 28 September 2011 - 05:10 PM

View PostjimmyBo, on 29 September 2011 - 12:06 AM, said:

You should still post your code - you could have the right code just the wrong way round or with a couple of incorrect bits that we can help you iron out.


Lol trust me it doesn't and won't work. I'm seriously stuck. Pretty much what I need help with is the pseudocode behind it.
Was This Post Helpful? 0
  • +
  • -

#4 Nemesis4895  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 46
  • Joined: 06-December 10

Re: Create multi-dimension array from multiple text files

Posted 28 September 2011 - 05:30 PM

Here's an idea I currently have that may work, not sure.

1. Split string in text box to two separate word list directories
2. For each word list, read from text file and create 1d Array
3. Create multi-dimensional array from the 1d arrays.

Getting from 2 to 3 is where I'm stuck.
Was This Post Helpful? 0
  • +
  • -

#5 DimitriV  Icon User is offline

  • Don't try to save yourself… the circle is complete
  • member icon

Reputation: 544
  • View blog
  • Posts: 2,632
  • Joined: 24-July 11

Re: Create multi-dimension array from multiple text files

Posted 28 September 2011 - 07:58 PM

View PostNemesis4895, on 29 September 2011 - 10:10 AM, said:

View PostjimmyBo, on 29 September 2011 - 12:06 AM, said:

You should still post your code - you could have the right code just the wrong way round or with a couple of incorrect bits that we can help you iron out.


Lol trust me it doesn't and won't work. I'm seriously stuck. Pretty much what I need help with is the pseudocode behind it.

Well I can't argue with that.
Was This Post Helpful? 0
  • +
  • -

#6 Nemesis4895  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 46
  • Joined: 06-December 10

Re: Create multi-dimension array from multiple text files

Posted 28 September 2011 - 08:10 PM

View PostjimmyBo, on 29 September 2011 - 02:58 AM, said:

View PostNemesis4895, on 29 September 2011 - 10:10 AM, said:

View PostjimmyBo, on 29 September 2011 - 12:06 AM, said:

You should still post your code - you could have the right code just the wrong way round or with a couple of incorrect bits that we can help you iron out.


Lol trust me it doesn't and won't work. I'm seriously stuck. Pretty much what I need help with is the pseudocode behind it.

Well I can't argue with that.


Heres what I've managed to come up with the mean time.

Private Sub btnStartRandGen_Click(sender As System.Object, e As System.EventArgs) Handles btnStartRandGen.Click
        If CountWords(tbWordList.Text) = CountWords(tbRandGenColumns.Text) Then

            Dim words As String() = tbWordList.Text.Split(New Char() {"/"c})
            Dim ii As Integer = 0

            'Dim StringArray(CreateArray(words(0)), CreateArray(words(1))) As String ' = (CreateArray(words(0)), CreateArray(words(1)))
            Dim StringArray()() As String = {CreateArray(words(0)), CreateArray(words(1))}
            RichTextBox1.Text = StringArray.Length

            Dim randstring As New Random
            'Call(SQLGen(tbSQLName.Text, tbUsername.Text, tbPassword.Text, tbDBName.Text, tbTable.Text, tbRandGenColumns.Text, StringArray, tbNumRows.Text))
            While ii < StringArray.Length
                'RichTextBox1.AppendText(StringArray(randstring.Next(0, StringArray(0)(0).Length))(randstring.Next(0, StringArray(0)(0).Length)) + Environment.NewLine)
                RichTextBox1.AppendText(StringArray(ii)(ii) + Environment.NewLine)
                ii = ii + 1
            End While
        Else
            MessageBox.Show("Amount of wordlists and columns do not match. Please use 1 wordlist per column to continue")
        End If

    Shared Function CreateArray(ByVal FilePath As String) As String()
        Dim StringArrayOfTextLines() As String = File.ReadAllLines(FilePath)
        Return StringArrayOfTextLines


    End Function



This doesn't return an error but it doesn't work how I want it. When I check the length of the array it returns two, where as it should return a number around 12000.

This post has been edited by Nemesis4895: 28 September 2011 - 08:14 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1