public static byte[] GetAttachmentContent(string fileName)
{
byte[] data = null;
FileStream fs = null;
try
{
fs = File.Open(fileName, FileMode.Open);
int len = (int)fs.Length;
data = new byte[len];
fs.Read(data, 0, len);
}
catch (IOException exp)
{
testSite.Debug.Fail(ErrorMessageTemplate, "reading content in the file " + fileName, exp.InnerException);
}
finally
{
if (fs != null)
{
fs.Close();
}
}
return data;
}