hi,
I am triying to assing values dynamically toa array string here i am triying to write
code as follows
this.openFileDialogimage.ShowDialog().Equals(DialogResult.OK);
string drname = Path.GetDirectoryName(this.openFileDialogimage.FileNames[0]);
foreach (string file in this.openFileDialogimage.FileNames)
{
int i;
for (i = 0; i <= Convert.ToInt32(openFileDialogimage.FileNames.Count()); i++)
{
string[] str = new string[Convert.ToChar(openFileDialogimage.FileNames.Count())];
}
}
help me how to procede
regard's,
Maruthi.
Loading
Mahesh ChandPosted Jun 27, 2008, 6:06 AM
What exactly are you trying to do? Are you trying to read all characters of a string? Or trying to get a list of all files in a directory? If you just want to read all file names and assign them to a dynamic array, simply use an ArrayList object and use Add method. Something like this:
ArrayList al = new ArrayList();
this.openFileDialogimage.ShowDialog().Equals(DialogResult.OK);
string drname = Path.GetDirectoryName(this.openFileDialogimage.FileNames[0]);
foreach (string file in this.openFileDialogimage.FileNames)
{
al.Add(file);
}