private bool WriteFile(string filename, byte[] data, string path)
{
try
{
// check if the path exists
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
System.IO.File.WriteAllBytes(string.Format(@"{0}\{1}", path, filename), data);
return true;
}
catch
{
return false;
}
}