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;
}
}

posted on 2022-05-05 14:07  小小先生、  阅读(36)  评论(0编辑  收藏  举报

导航