I have a two separate files that I need to first initialize. One file has zipcodes(int) and the other has salaries (decimals). Each file has 500+ numbers. I need to write a code that when i put a number in a salary in a textbox, it will give me the salary for that zip code. For Ex. if the zip code i put in is on line 50 in the first file, then the salary will be on line 50 in the second file. My code is not written correctly.
string[] lines = new string[917];
string fileName = "AGI_FL-1-1.txt";
StreamReader file = new StreamReader(fileName);
int[] agi = new int[917];
for (int x = 0; x > lines.Length; x++)
{
lines[x] = file.ReadLine();
label2.Text = "";
agi[x] = int.Parse(Console.ReadLine());
}
file.Close();
string zip = "AGI_FL_ZipCodes-1.txt";
StreamWriter info = new StreamWriter(zip);
for (int x = 0; x < agi.Length; x++)
{
info.WriteLine("{0} is {1} AGI, lines[x], zip[x]");
}
info.Close();
}