It's as follows, I have a DataGridView
with multiple columns. In each line of this DataGridView
will be presented the installation path of a program. With this displayed value, I'd like to use it to get the size of that folder and put it in a new column.
I have a method to calculate the size of a string:
private static long ObterTamanhoDiretorio(string tamanhoDir)
{
DirectoryInfo dire = new DirectoryInfo(tamanhoDir.ToString());
return dire.EnumerateFiles("*.*", SearchOption.AllDirectories).Sum(fi => fi.Length);
}
I do not know if it's something like this that I have to use.
foreach (DataGridViewRow item in dataGridView1.Rows)
{
}
What I like to know is how to get this value by seeing each line. If you have any ideas, thank you.