FileStream fileStream = null;
try
{
fileStream = new FileStream(sReportXmlFn, FileMode.Create, FileAccess.Write);
//write the file
fileStream.Write(btBuf, 0, btBuf.Length);
fileStream.Flush();//clear the buffer,write the data to the hard disk
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
finally
{
fileStream.Close();
}
}