Without interop and as the first comment, as soon as the dialogue is completed, i.e. / s file was selected, this will give a size.
public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { if (openFileDialog1.ShowDialog() == DialogResult.OK) { if (openFileDialog1.Multiselect) { long total = 0; foreach (string s in openFileDialog1.FileNames) total += new FileInfo(s).Length; MessageBox.Show(total.ToString()); } else { MessageBox.Show(new FileInfo(openFileDialog1.FileName).Length.ToString()); } } }
File size during the dialog I think you will need to use interop
Andrew
REA_ANDREW
source share