html模板读取
public static class TxtHelper
{
public static string ReadFile(string fileName)
{
FileStream fs = File.OpenRead(fileName);
using (StreamReader reader = new StreamReader(fs))
{
string content = reader.ReadToEnd();
return content;
}
}
public static string ReadFileContent(string templateName)
{
var startDir = Directory.GetCurrentDirectory();
string templatePath = Path.Combine(startDir, templateName);
var mailBodyf = ReadFile(templatePath);
return mailBodyf;
}
}