43 lines
1.3 KiB
C#
43 lines
1.3 KiB
C#
namespace EgwCoreLib.Lux.Core
|
|
{
|
|
public class FileUtils
|
|
{
|
|
#region Public Methods
|
|
|
|
/// <summary>
|
|
/// Restituisce il contenuto del file salvato
|
|
/// </summary>
|
|
/// <param name="folderPath">Path completo (da share/base path + folder)</param>
|
|
/// <param name="secureName">Nome del file "obfuscated"</param>
|
|
/// <returns></returns>
|
|
public static string LoadFileContent(string folderPath, string secureName)
|
|
{
|
|
string answ = "";
|
|
if (!string.IsNullOrEmpty(folderPath))
|
|
{
|
|
try
|
|
{
|
|
// calcolo path file...
|
|
string filePath = Path.Combine(folderPath, secureName);
|
|
if (File.Exists(filePath))
|
|
{
|
|
answ = File.ReadAllText(filePath);
|
|
}
|
|
}
|
|
catch (Exception exc)
|
|
{
|
|
Log.Error($"Exception on LoadFileContent{Environment.NewLine}{exc}");
|
|
}
|
|
}
|
|
return answ;
|
|
}
|
|
|
|
#endregion Public Methods
|
|
|
|
#region Private Fields
|
|
|
|
private static Logger Log = LogManager.GetCurrentClassLogger();
|
|
|
|
#endregion Private Fields
|
|
}
|
|
} |