Well here's my code.
The error appears at string curex = Extensions.GetValue(k).ToString();
I know the arrary Extensions isn't null (I think, I tested it, and it proved to have things in it!)
foreach (string f in Directory.GetFiles(MainLocation))
{
char[] delimiterChars = { '\\' };
char[] others = { '.' };
string[] a = f.ToString().Split(delimiterChars);
string[] b = a.GetValue(a.Length - 1).ToString().Split(others);
string ex = b.GetValue(0).ToString();
string curfile = MainLocation + "//"+ b.GetValue(0).ToString() + "." + b.GetValue(1).ToString();
for (int k = 0; k < Extensions.Length; k++)
{
char[] remove = { '$' };
string curex = Extensions.GetValue(k).ToString();
string[] s = curex.Split(remove);
string title = s.GetValue(0).ToString();
string searchex = s.GetValue(1).ToString();
if (searchex == ex)
{
MessageBox.Show(curfile + "\n" + ex + "\n" + searchex);
}
}
}
This is the globar var I am using.
string[] Extensions = new string[1000000]; //Big number I know :p
This is where I am adding values to the arrary.
The MessageBox seems to give me a value;
while ((line = sr.ReadLine()) != null)
{
if (line == "") goto Finish;
if (x == 0) Locations.SetValue(FileName + "$" + line.ToString(), Locations.Length - 1);
if (x != 0)
{
Extensions.SetValue(FileName + "$" + line.ToLower().ToString(), Extensions.Length - 1);
MessageBox.Show(Extensions.GetValue(Extensions.Length - 1).ToString());
}
x++;
}
This post has been edited by Bloobury: 18 July 2009 - 01:51 PM

New Topic/Question
Reply




MultiQuote





|