OpenFileDialog
if (DialogResult.OK == openFileDialog1.ShowDialog()) { FileInfo fi = new FileInfo(openFileDialog1.FileNamefile); long fileSize = fi.Length; //The size of the current file in bytes.file }
System.Windows.Forms.FileDialog.HookProc
SaveFileDialog
private void openFileDialog1_FileOk(object sender, CancelEventArgs e) { FileInfo info = new FileInfo(openFileDialog1.FileName); if (info.Length > "yourFilesize") e.Cancel=true; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)