Why does it complain about it not being able to convert a string array to a string when the values are strings within a string array
Code:
int i;
string[] Filenames;
OpenFileDialog UnConvertedFilesList = new OpenFileDialog();
if (UnConvertedFilesList.ShowDialog() == DialogResult.OK)
{
foreach (string FileName in UnConvertedFilesList.FileNames)
{
//Right Here
Filenames[i] = Filenames;
AudioFiles_listbox.Items.Add(FileName);
i++;
}
}//if
else
{
MessageBox.Show("File does not exist");
}
edit: that line to Changed Filenames[i] = FileName
Now it says "Use of unassigned local variable 'Filenames' and same thing for i
Their defined at the top of the function.