FileInfo oFileInfo = new FileInfo(strFilename); if (oFileInfo != null || oFileInfo.Length == 0) { MessageBox.Show("My File's Name: \"" + oFileInfo.Name + "\""); // For calculating the size of files it holds. MessageBox.Show("myFile total Size: " + oFileInfo.Length.ToString()); }