segue um exemplo
public void CarregaImagem(String imgCaminho)
{
try
{
if (string.IsNullOrEmpty(imgCaminho))
return;
FileInfo arqImagem = new FileInfo(imgCaminho);
FileStream fs = new FileStream(imgCaminho, FileMode.Open, FileAccess.Read, FileShare.Read);
this.ProFoto = new byte[Convert.ToInt32(arqImagem.Length)];
int iBytesRead = fs.Read(this.ProFoto, 0, Convert.ToInt32(arqImagem.Length));
fs.Close();
}
catch (Exception ex)
{
throw new Exception(ex.Message.ToString());
}
}
Alexandre Maranhão amprog@outlook.com