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.
5 Replies - 911 Views - Last Post: 28 September 2011 - 08:10 PM
#1
Create multi-dimension array from multiple text files
Posted 28 September 2011 - 05:03 PM
Replies To: Create multi-dimension array from multiple text files
#2
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.
#3
Re: Create multi-dimension array from multiple text files
Posted 28 September 2011 - 05:10 PM
jimmyBo, 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.
#4
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.
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.
#5
Re: Create multi-dimension array from multiple text files
Posted 28 September 2011 - 07:58 PM
Nemesis4895, on 29 September 2011 - 10:10 AM, said:
jimmyBo, 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.
#6
Re: Create multi-dimension array from multiple text files
Posted 28 September 2011 - 08:10 PM
jimmyBo, on 29 September 2011 - 02:58 AM, said:
Nemesis4895, on 29 September 2011 - 10:10 AM, said:
jimmyBo, 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
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote



|