1:
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
strFileName = openFileDialog1.FileName;
pbxContact.Image = Image.FromFile(strFileName);
try
{
FileStream fs = new FileStream(strFileName, FileMode.Open,FileAccess .Read );
int len = Convert.ToInt32(fs.Length);
btPhoto = new byte[fs.Length];
int nByteRead = fs.Read(btPhoto, 0, len);
fs.Close();
}
catch (Exception e1)
{
MessageBox.Show(e1.Message);
}
}
错误:if{}其作用域过大。