forked from ZeusAutomacao/DFe.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFrxFileHelper.cs
More file actions
28 lines (26 loc) · 788 Bytes
/
FrxFileHelper.cs
File metadata and controls
28 lines (26 loc) · 788 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using System;
using System.IO;
using System.Reflection;
namespace DFe.Utils
{
public static class FrxFileHelper
{
public static byte[] TryGetFrxFile(string caminho)
{
try
{
if (!caminho.EndsWith(".frx"))
{
caminho += ".frx";
}
var path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? throw new InvalidOperationException("Erro no Zeus. Assembly de relatório nao encontrado"), caminho);
var bytes = File.ReadAllBytes(path);
return bytes.Length == 0 ? null : bytes;
}
catch (Exception e)
{
return null;
}
}
}
}