public string LoadSourceFile(string pathToIndicator, out string errorLoadSourceFile)
{
string result = string.Empty;
if (!File.Exists(pathToIndicator))
{
errorLoadSourceFile = "ERROR The source file does not exist: " + Path.GetFileName(pathToIndicator);
return result;
}
try
{
using (System.IO.StreamReader sr = new System.IO.StreamReader(pathToIndicator))
{
result = sr.ReadToEnd();
sr.Close();
}
}
catch
{
errorLoadSourceFile = "ERROR Cannot read the file: " + Path.GetFileName(pathToIndicator);
return result;
}
errorLoadSourceFile = string.Empty;
return result;
}